Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.