aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Fair <allen.fair@gmail.com>2014-02-20 17:39:45 -0500
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2014-03-04 11:25:52 -0300
commit3624ff720cf98293034d7d5fe87c08f5520099d6 (patch)
tree416f8be70ba7140fcb03b35bb2c133910a44dc9e
parent8ed0f542ddd1f38b0b42f595d828d2e4db9b6682 (diff)
downloadrails-3624ff720cf98293034d7d5fe87c08f5520099d6.tar.gz
rails-3624ff720cf98293034d7d5fe87c08f5520099d6.tar.bz2
rails-3624ff720cf98293034d7d5fe87c08f5520099d6.zip
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.
-rw-r--r--railties/lib/rails/generators/erb.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/erb.rb b/railties/lib/rails/generators/erb.rb
index cfd77097d5..33f8a9da6f 100644
--- a/railties/lib/rails/generators/erb.rb
+++ b/railties/lib/rails/generators/erb.rb
@@ -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