Skip to content

Instantly share code, notes, and snippets.

@Martin91
Created March 10, 2017 07:49
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 Martin91/d3ebb72fa83c60155d216f1be34791a7 to your computer and use it in GitHub Desktop.
Save Martin91/d3ebb72fa83c60155d216f1be34791a7 to your computer and use it in GitHub Desktop.
rails application decorator mechanism
config.to_prepare do
# Load application's model / class decorators
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment