Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 45 lines (35 sloc) 1.495 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::Rail…
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 objec…
josevalim authored
7 config.action_mailer = ActiveSupport::OrderedOptions.new
2801786 @josevalim Get rid of config.preload_frameworks in favor of config.eager_load_na…
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 t…
josevalim authored
10 initializer "action_mailer.logger" do
4aded43 @wycats Replace the placeholder base_hook API with on_load. To specify some c…
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 t…
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.…
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 o…
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.…
drogus authored
21
6067d16 @josevalim Call it compile_methods! and do the same on AM.
josevalim authored
22 # make sure readers methods get compiled
5266eb9 @pokonski Default relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"]. Fixes #3365
pokonski authored
23 options.asset_host ||= app.config.asset_host
24 options.relative_url_root ||= app.config.relative_url_root
6067d16 @josevalim Call it compile_methods! and do the same on AM.
josevalim authored
25
4aded43 @wycats Replace the placeholder base_hook API with on_load. To specify some c…
wycats authored
26 ActiveSupport.on_load(:action_mailer) do
56ef192 @drogus ActionMailer should not depend on ActionDispatch
drogus authored
27 include AbstractController::UrlFor
e5af8b7 @drogus Moved ActionMailer and ActionController railties options to inherited…
drogus authored
28 extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
18aee33 @drogus Do not require passing :app to mounted helpers, it's actually useless…
drogus authored
29 include app.routes.mounted_helpers
284ca81 @joshk remove AM delegating register_observer and register_interceptor to Ma…
joshk authored
30
31 register_interceptors(options.delete(:interceptors))
32 register_observers(options.delete(:observers))
33
76b6136 @josevalim Clean up AM and AC railties.
josevalim authored
34 options.each { |k,v| send("#{k}=", v) }
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
35 end
36 end
6067d16 @josevalim Call it compile_methods! and do the same on AM.
josevalim authored
37
38 initializer "action_mailer.compile_config_methods" do
39 ActiveSupport.on_load(:action_mailer) do
40 config.compile_methods! if config.respond_to?(:compile_methods!)
41 end
42 end
d2bd71a Finish moving config.frameworks-dependent code to the framework plugin
Carlhuda authored
43 end
8fdeff0 @drogus mounted helpers should be included in ActionMailer
drogus authored
44 end
Something went wrong with that request. Please try again.