Sha256: 3eb8c13b8455dcc7929af8c55307da13fb8d0b7646016f57fa680db491616447

Contents?: true

Size: 461 Bytes

Versions: 28

Compression:

Stored size: 461 Bytes

Contents

class Money
  module BlankMongoizing
    def mongoize(value)
      return nil if value.blank?
      super(value)
    end
  end

  class << self
    prepend BlankMongoizing
  end

  alias_method :to_m, :to_money

  def as_json(*)
    Money.mongoize(self)
  end

  def to_json(*)
    as_json.to_json
  end
end

class Numeric
  alias_method :to_m, :to_money
end

class String
  alias_method :to_m, :to_money
end

class NilClass
  alias_method :to_m, :to_money
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.27 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.26 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.25 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.23 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.22 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.21 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.20 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.19 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.18 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.17 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.16 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.15 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.14 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.13 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.12 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.11 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.10 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.9 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.8 lib/workarea/ext/freedom_patches/money.rb
workarea-core-3.5.7 lib/workarea/ext/freedom_patches/money.rb