diff options
author | rohit <rohit.arondekar@gmail.com> | 2010-09-02 15:28:00 +0530 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-02 12:59:21 +0200 |
commit | d2fc5e2f6575b4111f2f87ebca7f021e681d4df9 (patch) | |
tree | ae9f74374c17fcfd8375a42c5e450172f3c26979 | |
parent | 8ffa695cecfbaf63f2ad15adcc06593df8432976 (diff) | |
download | rails-d2fc5e2f6575b4111f2f87ebca7f021e681d4df9.tar.gz rails-d2fc5e2f6575b4111f2f87ebca7f021e681d4df9.tar.bz2 rails-d2fc5e2f6575b4111f2f87ebca7f021e681d4df9.zip |
Output a friendly message when no type given for GeneratedAttribute [#5461 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | railties/lib/rails/generators/generated_attribute.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index 3b9fff2f4a..64273e4ca4 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -6,6 +6,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? @name, @type = name, type.to_sym end |