Skip to content

Add Rails 4.x reloading instructions #658

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

Closed
wants to merge 1 commit into from

Conversation

chendo
Copy link

@chendo chendo commented Jun 4, 2014

I ran into "Circular dependency detected while autoloading constant" errors when using the Rails 3.x reload code. I found removing the explicitly_unloadable_constants line made it work fine.

I ran into "Circular dependency detected while autoloading constant" errors when using the Rails 3.x reload code. I found removing the `explicitly_unloadable_constants` line made it work fine.
@dblock
Copy link
Member

dblock commented Jun 4, 2014

These instructions are basically identical to Rails 3 minus explicitly_unloadable_constants, but I don't think it's about the version of Rails. There's something else going on with these explicitly unloadable constants, do you happen to understand exactly what? I don't :) I think we need that explanation.

@chendo
Copy link
Author

chendo commented Jun 4, 2014

Yeah, they are :p Adding the constants to explicitly_unloadable_constants never made sense to me, so I’m thinking it was a workaround that worked in Rails 3.x but Rails 4 seems to handle reloading Grape APIs fine in 4.x. I didn’t have time to dig deeper but I thought other people might want to know how to get it working in Rails 4.x first even if we don’t entirely understand how it works :)

On Thursday, 5 June 2014 at 1:53 am, Daniel Doubrovkine (dB.) @dblockdotorg wrote:

These instructions are basically identical to Rails 3 minus explicitly_unloadable_constants, but I don't think it's about the version of Rails. There's something else going on with these explicitly unloadable constants, do you happen to understand exactly what? I don't :) I think we need that explanation.


Reply to this email directly or view it on GitHub (#658 (comment)).

@dblock
Copy link
Member

dblock commented Jun 4, 2014

Maybe just rewrite instructions that say "Rails" and explicitly call out to add the one line for Rails3?

@dblock
Copy link
Member

dblock commented Jul 6, 2014

Bump.

@dspaeth-faber
Copy link
Contributor

Maybe you can use

ActionDispatch::Reloader.to_prepare do
   api_reloader.execute_if_updated
end

insteed of ActionDispatch::Callbacks. So you don't need the if block.

@dblock
Copy link
Member

dblock commented Jul 8, 2014

@dspaeth-faber If you want to rewrite the rails reloading instructions that'd be great. I'd appreciate a working PR into https://github.com/dblock/grape-on-rails to demonstrate this, too.

@paganotoni
Copy link

@dblock is this one closed ?

@dblock
Copy link
Member

dblock commented Oct 3, 2014

I still want instructions for Rails 4 reloading. Just not exactly what's here.

@dblock
Copy link
Member

dblock commented Dec 14, 2014

I made a change based on all of this in #849, if something is not right there, please open a new issue!

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

Successfully merging this pull request may close these issues.

4 participants