lib/rails/generators/generated_attribute.rb in railties-3.1.12 vs lib/rails/generators/generated_attribute.rb in railties-3.2.0.rc1
- old
+ new
@@ -5,10 +5,10 @@
module Generators
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?
+ type = :string if type.blank?
@name, @type = name, type.to_sym
end
def field_type
@field_type ||= case type