Sha256: bc559a76cb8243fd46ffdab2eedc73d76d2732a1bad42f85f2457f14daf8f3b1
Contents?: true
Size: 983 Bytes
Versions: 38
Compression:
Stored size: 983 Bytes
Contents
# encoding: utf-8 require "bigdecimal" module Mongoid class Criteria module Queryable module Extensions # The big decimal module adds custom behaviour for Origin onto the # BigDecimal class. module BigDecimal module ClassMethods # Evolves the big decimal into a MongoDB friendly value - in this case # a string. # # @example Evolve the big decimal # BigDecimal.evolve(decimal) # # @param [ BigDecimal ] object The object to convert. # # @return [ String ] The big decimal as a string. # # @since 1.0.0 def evolve(object) __evolve__(object) do |obj| obj ? obj.to_s : obj end end end end end end end end ::BigDecimal.__send__(:extend, Mongoid::Criteria::Queryable::Extensions::BigDecimal::ClassMethods)
Version data entries
38 entries across 36 versions & 2 rubygems