Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 47 lines (36 sloc) 1.53 kb
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
1 require "action_mailer"
e749424 Rename rails.rb -> rails/all.rb and rails/core.rb -> rails.rb
Carl Lerche authored
2 require "rails"
4131a2d @drogus Move ActionController::Railties::RoutesHelpers and ActionMailer::Railtie...
drogus authored
3 require "abstract_controller/railties/routes_helpers"
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
4
5 module ActionMailer
e2c7545 @frodsan update ActionMailer documentation [ci skip]
frodsan authored
6 class Railtie < Rails::Railtie # :nodoc:
395d664 @josevalim Move application configuration to the application configuration object, ...
josevalim authored
7 config.action_mailer = ActiveSupport::OrderedOptions.new
2801786 @josevalim Get rid of config.preload_frameworks in favor of config.eager_load_names...
josevalim authored
8 config.eager_load_namespaces << ActionMailer
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
9
3b6f659 @josevalim Add active_model/railtie back to generated boot.rb, add models back to p...
josevalim authored
10 initializer "action_mailer.logger" do
4aded43 @wycats Replace the placeholder base_hook API with on_load. To specify some code...
wycats authored
11 ActiveSupport.on_load(:action_mailer) { self.logger ||= Rails.logger }
3b6f659 @josevalim Add active_model/railtie back to generated boot.rb, add models back to p...
josevalim authored
12 end
13
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
14 initializer "action_mailer.set_configs" do |app|
98ab4de @drogus Set only helpers_path on inherited hook in action_controller/railtie.rb ...
drogus authored
15 paths = app.config.paths
76b6136 @josevalim Clean up AM and AC railties.
josevalim authored
16 options = app.config.action_mailer
631dc61 @dhh Extract assets paths and make them available to Action Mailer as well
dhh authored
17
d649bf1 @josevalim Provide a cleaner syntax for paths configuration that does not rely on m...
josevalim authored
18 options.assets_dir ||= paths["public"].first
19 options.javascripts_dir ||= paths["public/javascripts"].first
20 options.stylesheets_dir ||= paths["public/stylesheets"].first
98ab4de @drogus Set only helpers_path on inherited hook in action_controller/railtie.rb ...
drogus authored
21
45537f0 @rafaelfranca Allow users to configure the queue for the mailers
rafaelfranca authored
22 options.queue ||= app.queue
23
6067d16 @josevalim Call it compile_methods! and do the same on AM.
josevalim authored
24 # make sure readers methods get compiled
5266eb9 @pokonski Default relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"]. Fixes #3365
pokonski authored
25 options.asset_host ||= app.config.asset_host
26 options.relative_url_root ||= app.config.relative_url_root
6067d16 @josevalim Call it compile_methods! and do the same on AM.
josevalim authored
27
4aded43 @wycats Replace the placeholder base_hook API with on_load. To specify some code...
wycats authored
28 ActiveSupport.on_load(:action_mailer) do
56ef192 @drogus ActionMailer should not depend on ActionDispatch
drogus authored
29 include AbstractController::UrlFor
e5af8b7 @drogus Moved ActionMailer and ActionController railties options to inherited ho...
drogus authored
30 extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
18aee33 @drogus Do not require passing :app to mounted helpers, it's actually useless an...
drogus authored
31 include app.routes.mounted_helpers
284ca81 @joshk remove AM delegating register_observer and register_interceptor to Mail ...
joshk authored
32
33 register_interceptors(options.delete(:interceptors))
34 register_observers(options.delete(:observers))
35
76b6136 @josevalim Clean up AM and AC railties.
josevalim authored
36 options.each { |k,v| send("#{k}=", v) }
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
37 end
38 end
6067d16 @josevalim Call it compile_methods! and do the same on AM.
josevalim authored
39
40 initializer "action_mailer.compile_config_methods" do
41 ActiveSupport.on_load(:action_mailer) do
42 config.compile_methods! if config.respond_to?(:compile_methods!)
43 end
44 end
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
45 end
8fdeff0 @drogus mounted helpers should be included in ActionMailer
drogus authored
46 end
Something went wrong with that request. Please try again.