public
Last active

Sweepers, observers, and mailers in separate dirs

  • Download Gist
environment.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12
# from Jacob Rothstein
# http://groups.google.com/group/rubyonrails-core/msg/019e27c1a5d6799e
 
%w( sweepers observers mailers ).each do |path|
config.load_paths.unshift File.join(Rails.root, 'app', path)
end
# 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 = observer_files.map { |f| File.basename f, '.rb' }

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.