Class: Rails::Generators::GeneratedAttribute
- Inherits:
-
Object
- Object
- Rails::Generators::GeneratedAttribute
- Defined in:
- lib/rails/generators/mongoid_generator.rb
Overview
Extension to Rails' GeneratedAttribute class.
Instance Method Summary collapse
-
#type_class ⇒ String
Returns the Mongoid attribute type value for a given input class type.
Instance Method Details
#type_class ⇒ String
Returns the Mongoid attribute type value for a given input class type.
29 30 31 32 33 34 35 |
# File 'lib/rails/generators/mongoid_generator.rb', line 29 def type_class return 'Time' if type == :datetime return 'String' if type == :text return 'Mongoid::Boolean' if type == :boolean type.to_s.camelcase end |