aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/named_base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/generators/named_base.rb')
-rw-r--r--railties/lib/generators/named_base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/generators/named_base.rb b/railties/lib/generators/named_base.rb
index 6ff5bb7644..4a5aba38d8 100644
--- a/railties/lib/generators/named_base.rb
+++ b/railties/lib/generators/named_base.rb
@@ -69,8 +69,8 @@ module Rails
# Convert attributes hash into an array with GeneratedAttribute objects.
#
def parse_attributes! #:nodoc:
- attributes.map! do |name, type|
- Rails::Generator::GeneratedAttribute.new(name, type)
+ self.attributes = (attributes || {}).map do |name, type|
+ Rails::Generators::GeneratedAttribute.new(name, type)
end
end