Created
July 17, 2010 05:32
-
-
Save dolzenko/479272 to your computer and use it in GitHub Desktop.
Sweepers, observers, and mailers in separate dirs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment