• M
    abstract all of the ActionMailer delivery methods into their own classes.... · f4f76772
    Matthew Rudy Jacobs 提交于
    abstract all of the ActionMailer delivery methods into their own classes. thereby the following are equivalent
    
      ActionMailer::Base.delivery_method = :smtp
      ActionMailer::Base.delivery_method = ActionMailer::DeliveryMethod::Smtp
    
    we could equally set our own custom object
    as long as it provides the instance method :perform_delivery(mail)
    
    eg.
    
      class MySmsDeliveryMethod
        def perform_delivery(mail)
          Sms.send(mail['to'], mail['body'])
        end
      end
    
      MySmsMailer.delivery_method = MySmsDeliveryMethod.new
    Signed-off-by: NJosé Valim <jose.valim@gmail.com>
    f4f76772
test_helper_test.rb 3.1 KB