模块:Mongoid::Criteria::Queryable::Extensions::BigDecimal::ClassMethods
- 定义于:
- lib/mongoid/criteria/queryable/extensions/big_decimal.rb
实例方法摘要折叠
-
# describe (object) ⇒ Object
将大十进制转换为MongoDB友好的值。
实例方法详细信息
# describe (object) ⇒ Object
将大十进制转换为MongoDB友好的值。
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/mongoid/criteria/queryable/extensions/big_decimal.rb', line 24 def 发展(对象) __evolve__(对象) do |obj| return if obj.nil? 案例 obj when ::BigDecimal if Mongoid.map_big_decimal_to_decimal 128 BSON::Decimal128.new(obj) else obj.to_s end when BSON::Decimal128 then obj else if obj.numeric? if Mongoid.map_big_decimal_to_decimal 128 BSON::Decimal128.new(对象.to_s) else obj.to_s end else obj end end end end |