class Rails::Generators::GeneratedAttribute

Extension to Rails’ GeneratedAttribute class.

Public Instance Methods

type_class() click to toggle source

Returns the Mongoid attribute type value for a given input class type.

@return [ String ] The type value.

# File lib/rails/generators/mongoid_generator.rb, line 34
def type_class
  return "Time" if type == :datetime
  return "String" if type == :text
  return "Mongoid::Boolean" if type == :boolean
  type.to_s.camelcase
end