class method
self.new
Ruby on Rails 3.2.22.5
Since v3.0.20 Last seen in v3.2.22.5Signature
self.new(name, type=nil, index_type=false, attr_options={})
No documentation comment.
Parameters
-
namereq -
typeopt = nil -
index_typeopt = false -
attr_optionsopt = {}
Source
# File railties/lib/rails/generators/generated_attribute.rb, line 40
def initialize(name, type=nil, index_type=false, attr_options={})
@name = name
@type = (type.presence || :string).to_sym
@has_index = %w(index uniq).include?(index_type)
@has_uniq_index = %w(uniq).include?(index_type)
@attr_options = attr_options
end
Defined in railties/lib/rails/generators/generated_attribute.rb line 40
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::GeneratedAttribute