Sha256: 99c8f7b22eaf59ff2964060b74b0c97c2f9ee23565a4f5ef6aa406e66285618c

Contents?: true

Size: 1.46 KB

Versions: 130

Compression:

Stored size: 1.46 KB

Contents

require "action_mailer"
require "rails"
require "abstract_controller/railties/routes_helpers"

module ActionMailer
  class Railtie < Rails::Railtie
    config.action_mailer = ActiveSupport::OrderedOptions.new

    initializer "action_mailer.logger" do
      ActiveSupport.on_load(:action_mailer) { self.logger ||= Rails.logger }
    end

    initializer "action_mailer.set_configs" do |app|
      paths   = app.config.paths
      options = app.config.action_mailer

      options.assets_dir      ||= paths["public"].first
      options.javascripts_dir ||= paths["public/javascripts"].first
      options.stylesheets_dir ||= paths["public/stylesheets"].first

      # make sure readers methods get compiled
      options.asset_path          ||= app.config.asset_path
      options.asset_host          ||= app.config.asset_host
      options.relative_url_root   ||= app.config.relative_url_root

      ActiveSupport.on_load(:action_mailer) do
        include AbstractController::UrlFor
        extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
        include app.routes.mounted_helpers

        register_interceptors(options.delete(:interceptors))
        register_observers(options.delete(:observers))

        options.each { |k,v| send("#{k}=", v) }
      end
    end

    initializer "action_mailer.compile_config_methods" do
      ActiveSupport.on_load(:action_mailer) do
        config.compile_methods! if config.respond_to?(:compile_methods!)
      end
    end
  end
end

Version data entries

130 entries across 104 versions & 11 rubygems

Version Path
initforthe-cookies-0.0.1 vendor/bundle/gems/actionmailer-3.2.6/lib/action_mailer/railtie.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.6/lib/action_mailer/railtie.rb
actionmailer-3.2.6 lib/action_mailer/railtie.rb
challah-0.6.1 vendor/bundle/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
challah-0.6.1 vendor/bundle/gems/actionmailer-3.2.2/lib/action_mailer/railtie.rb
challah-0.6.1 vendor/bundle/gems/actionmailer-3.2.1/lib/action_mailer/railtie.rb
challah-0.6.1 vendor/bundle/gems/actionmailer-3.2.5/lib/action_mailer/railtie.rb
actionmailer-3.2.5 lib/action_mailer/railtie.rb
actionmailer-3.2.4 lib/action_mailer/railtie.rb
actionmailer-3.2.4.rc1 lib/action_mailer/railtie.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/actionmailer-3.2.3/lib/action_mailer/railtie.rb