aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/named_base.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-21 12:00:02 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-21 12:00:02 +0200
commit10fd0217894fbdf600f3ea6cf080598ce0569809 (patch)
tree6624ddf2b9b790096fb4e5a2dce0339c52f5283c /railties/lib/generators/named_base.rb
parentc90419d4f4a77e538707f67ea2ab22acdaa92d46 (diff)
downloadrails-10fd0217894fbdf600f3ea6cf080598ce0569809.tar.gz
rails-10fd0217894fbdf600f3ea6cf080598ce0569809.tar.bz2
rails-10fd0217894fbdf600f3ea6cf080598ce0569809.zip
Change attributes default type to array to allow order to be preserved.
Diffstat (limited to 'railties/lib/generators/named_base.rb')
-rw-r--r--railties/lib/generators/named_base.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/generators/named_base.rb b/railties/lib/generators/named_base.rb
index 0d399c876c..699b8ed651 100644
--- a/railties/lib/generators/named_base.rb
+++ b/railties/lib/generators/named_base.rb
@@ -41,7 +41,8 @@ module Rails
# Convert attributes hash into an array with GeneratedAttribute objects.
#
def parse_attributes! #:nodoc:
- self.attributes = (attributes || {}).map do |name, type|
+ self.attributes = (attributes || []).map do |key_value|
+ name, type = key_value.split(':')
Rails::Generators::GeneratedAttribute.new(name, type)
end
end