class method
self.new
Ruby on Rails 3.0.20
Since v3.0.20 Last seen in v3.2.22.5Signature
self.new(name, type)
No documentation comment.
Parameters
-
namereq -
typereq
Source
# File railties/lib/rails/generators/generated_attribute.rb, line 8
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
Defined in railties/lib/rails/generators/generated_attribute.rb line 8
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::GeneratedAttribute