aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2017-01-05 17:20:57 +0900
committerAkira Matsuda <ronnie@dio.jp>2017-01-05 19:58:52 +0900
commit5473e390d362755125d2f47b64ef0a135f2fe111 (patch)
treeb9c199a3c78ad307ed034cf5618e2897dfa650c6 /actionmailer
parent6197a38bca988f05087aa022e288922cf0331d6c (diff)
downloadrails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.gz
rails-5473e390d362755125d2f47b64ef0a135f2fe111.tar.bz2
rails-5473e390d362755125d2f47b64ef0a135f2fe111.zip
`self.` is not needed when calling its own instance method
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer/delivery_methods.rb2
-rw-r--r--actionmailer/lib/action_mailer/preview.rb2
-rw-r--r--actionmailer/lib/action_mailer/test_case.rb2
-rw-r--r--actionmailer/lib/rails/generators/mailer/mailer_generator.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/actionmailer/lib/action_mailer/delivery_methods.rb b/actionmailer/lib/action_mailer/delivery_methods.rb
index be98f4c65e..bcc4ef03cf 100644
--- a/actionmailer/lib/action_mailer/delivery_methods.rb
+++ b/actionmailer/lib/action_mailer/delivery_methods.rb
@@ -59,7 +59,7 @@ module ActionMailer
end
def wrap_delivery_behavior(mail, method = nil, options = nil) # :nodoc:
- method ||= self.delivery_method
+ method ||= delivery_method
mail.delivery_handler = self
case method
diff --git a/actionmailer/lib/action_mailer/preview.rb b/actionmailer/lib/action_mailer/preview.rb
index c147ca78d0..b0152aff03 100644
--- a/actionmailer/lib/action_mailer/preview.rb
+++ b/actionmailer/lib/action_mailer/preview.rb
@@ -63,7 +63,7 @@ module ActionMailer
# interceptors will be informed so that they can transform the message
# as they would if the mail was actually being delivered.
def call(email)
- preview = self.new
+ preview = new
message = preview.public_send(email)
inform_preview_interceptors(message)
message
diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb
index ebc7b37961..cbd841466d 100644
--- a/actionmailer/lib/action_mailer/test_case.rb
+++ b/actionmailer/lib/action_mailer/test_case.rb
@@ -57,7 +57,7 @@ module ActionMailer
end
def mailer_class
- if mailer = self._mailer_class
+ if mailer = _mailer_class
mailer
else
tests determine_default_mailer(name)
diff --git a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb
index 4a8d0178de..99fe4544f1 100644
--- a/actionmailer/lib/rails/generators/mailer/mailer_generator.rb
+++ b/actionmailer/lib/rails/generators/mailer/mailer_generator.rb
@@ -11,7 +11,7 @@ module Rails
template "mailer.rb", File.join("app/mailers", class_path, "#{file_name}_mailer.rb")
in_root do
- if self.behavior == :invoke && !File.exist?(application_mailer_file_name)
+ if behavior == :invoke && !File.exist?(application_mailer_file_name)
template "application_mailer.rb", application_mailer_file_name
end
end