diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-21 12:00:02 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-21 12:00:02 +0200 |
commit | 10fd0217894fbdf600f3ea6cf080598ce0569809 (patch) | |
tree | 6624ddf2b9b790096fb4e5a2dce0339c52f5283c /railties/lib/generators/named_base.rb | |
parent | c90419d4f4a77e538707f67ea2ab22acdaa92d46 (diff) | |
download | rails-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.rb | 3 |
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 |