Skip to content

Instantly share code, notes, and snippets.

@bjhess
Created October 27, 2009 20:52
Show Gist options
  • Save bjhess/219951 to your computer and use it in GitHub Desktop.
Save bjhess/219951 to your computer and use it in GitHub Desktop.
##
# Our Mailer is TFB, and thus I've brought the concerned_with pattern in to kick ass.
# Adapted from: http://paulbarry.com/articles/2008/08/30/concerned-with-skinny-controller-skinny-model
#
class << ActionMailer::Base
def concerned_with(*concerns)
concerns.each do |concern|
require_dependency "#{name.underscore}/#{concern}_mailer"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment