diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-04-22 14:30:07 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-04-22 14:30:07 +0900 |
commit | e4a0a048836512432b43c7fb623d32de2496a346 (patch) | |
tree | 2ac698e73f83b9a25970edbf3ea907420a7bf409 /railties | |
parent | 222f20eb192e4ec2f19d19cc37dc3ca601d55c8d (diff) | |
download | rails-e4a0a048836512432b43c7fb623d32de2496a346.tar.gz rails-e4a0a048836512432b43c7fb623d32de2496a346.tar.bz2 rails-e4a0a048836512432b43c7fb623d32de2496a346.zip |
Strip duplicated suffixes more strictly
In the previous code incorrectly removes intermediate words.
Diffstat (limited to 'railties')
3 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index e2ea66415f..997602cb8c 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -35,7 +35,7 @@ module Erb # :nodoc: end def file_name - @_file_name ||= super.gsub(/_mailer/i, "") + @_file_name ||= super.sub(/_mailer\z/i, "") end end end diff --git a/railties/lib/rails/generators/test_unit/job/job_generator.rb b/railties/lib/rails/generators/test_unit/job/job_generator.rb index ab622ec5e4..1dae3cb6a5 100644 --- a/railties/lib/rails/generators/test_unit/job/job_generator.rb +++ b/railties/lib/rails/generators/test_unit/job/job_generator.rb @@ -13,7 +13,7 @@ module TestUnit # :nodoc: private def file_name - @_file_name ||= super.gsub(/_job/i, "") + @_file_name ||= super.sub(/_job\z/i, "") end end end diff --git a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb index 610d47a729..ab8331f31c 100644 --- a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb @@ -21,7 +21,7 @@ module TestUnit # :nodoc: private def file_name - @_file_name ||= super.gsub(/_mailer/i, "") + @_file_name ||= super.sub(/_mailer\z/i, "") end end end |