Skip to content
Browse files

Output a friendly message when no type given for GeneratedAttribute [#…

…5461 state:resolved]

Signed-off-by: José Valim <>
  • Loading branch information...
1 parent 8ffa695 commit d2fc5e2f6575b4111f2f87ebca7f021e681d4df9 @rohit rohit committed with josevalim Sep 2, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 railties/lib/rails/generators/generated_attribute.rb
1 railties/lib/rails/generators/generated_attribute.rb
@@ -6,6 +6,7 @@ class GeneratedAttribute
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

0 comments on commit d2fc5e2

Please sign in to comment.
Something went wrong with that request. Please try again.