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

Unreloader in the models.rb #15

Closed
Serhiy-Nazarov opened this issue May 11, 2019 · 2 comments
Closed

Unreloader in the models.rb #15

Serhiy-Nazarov opened this issue May 11, 2019 · 2 comments

Comments

@Serhiy-Nazarov
Copy link

As I understand, inside config.ru you use unreloader only for developer mode. But in the models.rb (12-17 rows) you add it for all modes. Can you explain the main point for this case?
On my opinion, we don't need to use it for non developer mode. Is not it?

@jeremyevans
Copy link
Owner

config.ru actually always uses rack-unreloader, but it only sets up the reloading in development mode (reload: dev). In models.rb, if the Unloader isn't already defined, one is defined but it is set to not actually do any reloading (reload: false). This is done so the same API can be used if the models.rb file is required directly (i.e. when not running the app using config.ru).

Hopefully that explains things, but if not, please let me know.

@Serhiy-Nazarov
Copy link
Author

understood. thanks!

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

No branches or pull requests

2 participants