Last active
August 29, 2015 14:16
-
-
Save nhattan/88b8468a18b10947ac06 to your computer and use it in GitHub Desktop.
Cache class in submodule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In genenal | |
# my_app/config/environments/development.rb | |
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# In the development environment your application's code is reloaded on | |
# every request. This slows down response time but is perfect for development | |
# since you don't have to restart the web server when you make code changes. | |
config.cache_classes = false | |
end | |
# my_app/my_submodule/app/models/user.rb | |
require MyEngine::Engine.root.join('app', 'models', 'user') | |
class User | |
# the code inside this class is cached, we must restart server to reload code | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment