lib/money-rails/mongoid/money.rb
# Takes any possible object and converts it to how it would be
# stored in the database.
Takes any possible object and converts it to how it would be
stored in the database.
Takes any possible object and converts it to how it would be stored in the database .
def mongoize(object)
      case
      when object.is_a?(Money) then object.mongoize
      when object.is_a?(Hash) then
        object.symbolize_keys! if object.respond_to?(:symbolize_keys!)
        ::Money.new(object[:cents], object[:currency_iso]).mongoize
      when object.respond_to?(:to_money) then
          object.to_money.mongoize
      else object
      end
    end
def mongoize ( object ) case when object . is_a? ( Money ) then object . mongoize when object . is_a? ( Hash ) then object . symbolize_keys! if object . respond_to? ( :symbolize_keys! ) :: Money . new ( object [ :cents ] , object [ :currency_iso ] ) . mongoize when object . respond_to? ( :to_money ) then object . to_money . mongoize else object end end
Takes any possible object and converts it to how it would be
stored in the database.
Takes any possible object and converts it to how it would be stored in the database .
object
<not_specific>