类:Rails::Generators::GenerateAttribute
- 继承:
-
对象
- 对象
- Rails::Generators::GeneratoredAttribute
- 定义于:
- lib/rails/generators/mongoid_generator.rb
Overview
Rails 生成属性类的扩展。
实例方法摘要折叠
-
# type_class ⇒ string
返回给定输入类类型的 Mongoid 属性类型值。
实例方法详细信息
# type_class ⇒ string
返回给定输入类类型的 Mongoid 属性类型值。
29 30 31 32 33 34 35 |
# File 'lib/rails/generators/mongoid_generator.rb', line 29 def type_class return ' Time ' if 类型 == :datetime return 'string' if 类型 == :text return ' Mongoid::Boolean ' if 类型 == :布尔值 类型.to_s.camelcase end |