Sha256: 76a6e8772efe42d455166ff8c7a5513266c0a0784626cb07025c63c67275f60a

Contents?: true

Size: 524 Bytes

Versions: 11

Compression:

Stored size: 524 Bytes

Contents

# Subclass of ActionMailer::Base that does not crash when the class
# is anonymous. Subclassed in the specs whenever a new mailer is
# needed
class AnonymousMailer < ActionMailer::Base
  class << self
    # Pretty much like super, but returns "anonymous" when no
    # name is set
    def mailer_name
      if @mailer_name or name
        super
      else
        "anonymous"
      end
    end

    # Was an alias. (e.g. pointed to the old, non-overridden method)
    def controller_path
      mailer_name
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
roadie-2.4.3 spec/support/anonymous_mailer.rb
md-roadie-2.4.2.md.1 spec/support/anonymous_mailer.rb
roadie-2.4.2 spec/support/anonymous_mailer.rb
roadie-2.4.1 spec/support/anonymous_mailer.rb
roadie-2.4.0 spec/support/anonymous_mailer.rb
roadie-2.3.4 spec/support/anonymous_mailer.rb
roadie-2.3.3 spec/support/anonymous_mailer.rb
roadie-2.3.2 spec/support/anonymous_mailer.rb
roadie-2.3.1 spec/support/anonymous_mailer.rb
roadie-2.3.0 spec/support/anonymous_mailer.rb
roadie-2.3.0.pre1 spec/support/anonymous_mailer.rb