mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user