diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-03-04 09:42:15 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-03-04 11:26:09 -0300 |
commit | ab1bd7ccf1cc38d271747dd95433a93b28a6e302 (patch) | |
tree | 5f3385c9660450bf64333fb1b193ffd057311f70 /railties/lib/rails | |
parent | 3624ff720cf98293034d7d5fe87c08f5520099d6 (diff) | |
download | rails-ab1bd7ccf1cc38d271747dd95433a93b28a6e302.tar.gz rails-ab1bd7ccf1cc38d271747dd95433a93b28a6e302.tar.bz2 rails-ab1bd7ccf1cc38d271747dd95433a93b28a6e302.zip |
Always return an array from formats so there is no need to wrap it when calling
Diffstat (limited to 'railties/lib/rails')
3 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/erb.rb b/railties/lib/rails/generators/erb.rb index 33f8a9da6f..0755ac335c 100644 --- a/railties/lib/rails/generators/erb.rb +++ b/railties/lib/rails/generators/erb.rb @@ -6,7 +6,7 @@ module Erb # :nodoc: protected def formats - format + [format] end def format diff --git a/railties/lib/rails/generators/erb/controller/controller_generator.rb b/railties/lib/rails/generators/erb/controller/controller_generator.rb index e62aece7c5..94c1b835d1 100644 --- a/railties/lib/rails/generators/erb/controller/controller_generator.rb +++ b/railties/lib/rails/generators/erb/controller/controller_generator.rb @@ -11,7 +11,7 @@ module Erb # :nodoc: actions.each do |action| @action = action - Array(formats).each do |format| + formats.each do |format| @path = File.join(base_path, filename_with_extensions(action, format)) template filename_with_extensions(:view, format), @path end diff --git a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb index b219f459ac..c94829a0ae 100644 --- a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb @@ -14,7 +14,7 @@ module Erb # :nodoc: def copy_view_files available_views.each do |view| - Array(formats).each do |format| + formats.each do |format| filename = filename_with_extensions(view, format) template filename, File.join("app/views", controller_file_path, filename) end |