Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't cache the base_path #167

Closed
wants to merge 1 commit into from

Conversation

bradrobertson
Copy link

base_path for some reason was being cached as a class local variable (even if you provide a proc in the config). This means that if you have a mutli-tenanted api (for instance app1.myapp.com/api and app2.myapp.com/api) if you switch between those 2 api docs, the baseUrl would always be the first one that the site accessed since it's cached on load.

There's really no reason to cache this, it should just be evaluated for each request.

@dblock
Copy link
Member

dblock commented Nov 7, 2014

Good catch. This needs a spec and a CHANGELOG entry please.

@bradrobertson
Copy link
Author

To be honest... I don't really think there's much of a test suite here anyway. I don't see a single assertion in the test/api.rb file.

It's pretty hard to make heads or tails of this whole repo due to its implementation. Feel free to accept it or close it if you'd rather.

@dblock
Copy link
Member

dblock commented Nov 7, 2014

You're looking in the wrong place :) The spec folder has a lot of RSpec tests.

The test should really be called demo. I'll rename it at some point.

@dblock
Copy link
Member

dblock commented Nov 7, 2014

Regarding the implementation, totally. The project evolved somewhat "organically". Hopefully someone will take a stab at rewriting most of this.

@dblock
Copy link
Member

dblock commented Nov 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants