From 10fd0217894fbdf600f3ea6cf080598ce0569809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 21 Jul 2009 12:00:02 +0200 Subject: Change attributes default type to array to allow order to be preserved. --- railties/lib/generators/named_base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/generators/named_base.rb') 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 -- cgit v1.2.3