Output a friendly message when no type given for GeneratedAttribute [#5461 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
rohit
2010-09-02 15:28:00 +05:30
committed by José Valim
parent 8ffa695cec
commit d2fc5e2f65

View File

@@ -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