Skip to content

Commit

Permalink
Output a friendly message when no type given for GeneratedAttribute [#…
Browse files Browse the repository at this point in the history
…5461 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
rohitarondekar authored and josevalim committed Sep 2, 2010
1 parent 8ffa695 commit d2fc5e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions railties/lib/rails/generators/generated_attribute.rb
Expand Up @@ -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
end

Expand Down

0 comments on commit d2fc5e2

Please sign in to comment.