class method
self.parse
Ruby on Rails 3.2.22.5
Since v3.2.22.5 Last seen in v3.2.22.5Signature
self.parse(column_definition)
No documentation comment.
Parameters
-
column_definitionreq
Source
# File railties/lib/rails/generators/generated_attribute.rb, line 12
def parse(column_definition)
name, type, has_index = column_definition.split(':')
# if user provided "name:index" instead of "name:string:index"
# type should be set blank so GeneratedAttribute's constructor
# could set it to :string
has_index, type = type, nil if %w(index uniq).include?(type)
type, attr_options = *parse_type_and_options(type)
new(name, type, has_index, attr_options)
end
Defined in railties/lib/rails/generators/generated_attribute.rb line 12
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Generators::GeneratedAttribute