diff options
author | José Valim <jose.valim@gmail.com> | 2011-06-17 15:10:53 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-06-17 15:10:53 -0300 |
commit | 08983fefd547142ef8b913af1859b96597753d9f (patch) | |
tree | 0b3d648ba38db34d114cbd8488692d85cf1f1d71 /railties/lib | |
parent | 9a64c8ec660a6dc20e8df26b0936502bd4c1ffb8 (diff) | |
download | rails-08983fefd547142ef8b913af1859b96597753d9f.tar.gz rails-08983fefd547142ef8b913af1859b96597753d9f.tar.bz2 rails-08983fefd547142ef8b913af1859b96597753d9f.zip |
Attributes on scaffold and model generators default to string.
This allows the following: "rails g scaffold Post title body:text author"
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/generated_attribute.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index 9450894b05..f9f89c9f1d 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -7,7 +7,7 @@ module Rails attr_accessor :name, :type def initialize(name, type) - raise Thor::Error, "Missing type for attribute '#{name}'.\nExample: '#{name}:string' where string is the type." if type.blank? + type = :string if type.blank? @name, @type = name, type.to_sym end |