From 7f5b51686c556e3a35a2e5320fe8e4d758ff70b5 Mon Sep 17 00:00:00 2001 From: Dmitrii Samoilov Date: Wed, 17 Aug 2011 12:16:04 +0300 Subject: added ability to specify from cli when generating a model/migration whether particular property should be an index like this 'rails g model person name:string:index profile:string' --- railties/lib/rails/generators/named_base.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails/generators/named_base.rb') diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index c6c0392f43..980d6068e3 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -153,9 +153,8 @@ module Rails # Convert attributes array into GeneratedAttribute objects. def parse_attributes! #:nodoc: - self.attributes = (attributes || []).map do |key_value| - name, type = key_value.split(':') - Rails::Generators::GeneratedAttribute.new(name, type) + self.attributes = (attributes || []).map do |attr| + Rails::Generators::GeneratedAttribute.new(attr) end end -- cgit v1.2.3