-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I just noticed on Mongoid master, I have a field: pu, type: Float and if I persist data like 11.0, 12.0 with set(:pu, 11.0) is saved normally as Float, but if I try update_attributes(pu: 11.0) is saved as Fixnum, Integer.
ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').update_attributes(pu: 13.5) => true ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').pu.class => Float ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').update_attributes(pu: 13) => true ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').pu.class => Fixnum ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').update_attributes(pu: 13.0) => true ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').pu.class => Fixnum ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').update_attributes(pu: 13.5) => true ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').pu.class => Float ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').update_attributes(pu: 13.0) => true ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').pu.class => Fixnum ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').set(:pu,13.0) => 13 ruby-1.9.3-p194 > Trst::Freight.find('4e317a1713e16c0dfc000018').pu.class => Float