Sha256: fce2c193be14bd7c1104de83c44a0ac7942a1160418e16e940097e7c80ba3211

Contents?: true

Size: 408 Bytes

Versions: 13

Compression:

Stored size: 408 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Extensions #:nodoc:
    module Float #:nodoc:
      module Conversions #:nodoc:
        def set(value)
          return nil if value.blank?
          begin
            Float(value)
          rescue ArgumentError => e
            puts(e.message); value
          end
        end
        def get(value)
          value
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
mongoid-1.9.5 lib/mongoid/extensions/float/conversions.rb
mongoid-with-auth-1.9.4 lib/mongoid/extensions/float/conversions.rb
mongoid-rails2-1.9.4 lib/mongoid/extensions/float/conversions.rb
mongoid-rails2-1.9.3 lib/mongoid/extensions/float/conversions.rb
mongoid-1.9.2 lib/mongoid/extensions/float/conversions.rb
sskirby-mongoid-1.9.1 lib/mongoid/extensions/float/conversions.rb
mongoid-2.0.0.beta.7 lib/mongoid/extensions/float/conversions.rb
mongoid-2.0.0.beta.8 lib/mongoid/extensions/float/conversions.rb
mongoid-2.0.0.beta.9 lib/mongoid/extensions/float/conversions.rb
mongoid-1.9.1 lib/mongoid/extensions/float/conversions.rb
chhean-mongoid-2.0.1.beta1 lib/mongoid/extensions/float/conversions.rb
mongoid-2.0.0.beta.5 lib/mongoid/extensions/float/conversions.rb
mongoid-1.9.0 lib/mongoid/extensions/float/conversions.rb