Permalink
Browse files

Always return an array from formats so there is no need to wrap it wh…

…en calling
  • Loading branch information...
1 parent 4ca8180 commit 332a359cbc7904b80341de8a41dcd2b740f5dbc2 @carlosantoniodasilva carlosantoniodasilva committed Mar 4, 2014
@@ -6,7 +6,7 @@ class Base < Rails::Generators::NamedBase #:nodoc:
protected
def formats
- format
+ [format]
end
def format
@@ -11,7 +11,7 @@ def copy_view_files
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
@@ -14,7 +14,7 @@ def create_root_folder
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

0 comments on commit 332a359

Please sign in to comment.