Class: Integer
Class Method Summary collapse
Class Method Details
.to_mongo(value) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/mongomapper/support.rb', line 73 def self.to_mongo(value) value_to_i = value.to_i if value_to_i == 0 value.to_s =~ /^(0x|0b)?0+/ ? 0 : nil else value_to_i end end |