Skip to content

Instantly share code, notes, and snippets.

@nhattan
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhattan/88b8468a18b10947ac06 to your computer and use it in GitHub Desktop.
Save nhattan/88b8468a18b10947ac06 to your computer and use it in GitHub Desktop.
Cache class in submodule
# 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