Skip to content

Commit

Permalink
Fix for external generators extend Erb::Generators
Browse files Browse the repository at this point in the history
HAML and probably other generators extend this class and invoke
filename_with_extensions with the old signature (without format).
This makes the second argument optional and defaults it to the #format
method which could be overridden as well.

Closes #14132.
  • Loading branch information
afair authored and carlosantoniodasilva committed Mar 4, 2014
1 parent 8ed0f54 commit 3624ff7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/erb.rb
Expand Up @@ -17,7 +17,7 @@ def handler
:erb
end

def filename_with_extensions(name, format)
def filename_with_extensions(name, format = self.format)
[name, format, handler].compact.join(".")
end
end
Expand Down

0 comments on commit 3624ff7

Please sign in to comment.