diff options
author | hnatt <hnatt88@gmail.com> | 2015-10-30 10:45:35 +0200 |
---|---|---|
committer | hnatt <hnatt88@gmail.com> | 2015-10-30 10:45:35 +0200 |
commit | 1be276beb4761caeb211443a4c2e7f4482b94ebc (patch) | |
tree | 6036adab045881b5593928c3ed475cbba43bf979 /actionmailer/lib | |
parent | baaf3769ff179248353ced0c60495c349a912fe1 (diff) | |
download | rails-1be276beb4761caeb211443a4c2e7f4482b94ebc.tar.gz rails-1be276beb4761caeb211443a4c2e7f4482b94ebc.tar.bz2 rails-1be276beb4761caeb211443a4c2e7f4482b94ebc.zip |
Rename ActionMailer::Base#class_from_value -> observer_class_for
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index c350cd5bcc..f535e25b2a 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -466,17 +466,17 @@ module ActionMailer # Either a class, string or symbol can be passed in as the Observer. # If a string or symbol is passed in it will be camelized and constantized. def register_observer(observer) - Mail.register_observer(class_from_value(observer)) + Mail.register_observer(observer_class_for(observer)) end # Register an Interceptor which will be called before mail is sent. # Either a class, string or symbol can be passed in as the Interceptor. # If a string or symbol is passed in it will be camelized and constantized. def register_interceptor(interceptor) - Mail.register_interceptor(class_from_value(interceptor)) + Mail.register_interceptor(observer_class_for(interceptor)) end - def class_from_value(value) + def observer_class_for(value) case value when String, Symbol value.to_s.camelize.constantize @@ -484,7 +484,7 @@ module ActionMailer value end end - private :class_from_value + private :observer_class_for # Returns the name of current mailer. This method is also being used as a path for a view lookup. # If this is an anonymous mailer, this method will return +anonymous+ instead. |