Create a gist now

Instantly share code, notes, and snippets.

Sweepers, observers, and mailers in separate dirs
# from Jacob Rothstein
%w( sweepers observers mailers ).each do |path|
config.load_paths.unshift File.join(Rails.root, 'app', path)
# For the archives, this is now autoload_paths.
config.action_mailer.template_root = File.join Rails.root, 'app', 'mailer_views'
observer_files = Dir[File.join(Rails.root, 'app', 'observers', '*.rb')]
config.active_record.observers = { |f| File.basename f, '.rb' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment