1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix for external generators extend Erb::Generators

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.
This commit is contained in:
Allen Fair 2014-02-20 17:39:45 -05:00 committed by Carlos Antonio da Silva
parent 8ed0f542dd
commit 3624ff720c

View file

@ -17,7 +17,7 @@ module Erb # :nodoc:
:erb
end
def filename_with_extensions(name, format)
def filename_with_extensions(name, format = self.format)
[name, format, handler].compact.join(".")
end
end