File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
lib/mongoid/criteria/queryable/extensions
spec/mongoid/criteria/queryable/extensions Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def evolve(object)
3333 end
3434 # Always return on string for backwards compatibility with querying
3535 # string-backed BigDecimal fields.
36- when BSON ::Decimal128 , String then obj
36+ when BSON ::Decimal128 then obj
3737 else
3838 if obj . numeric?
3939 if Mongoid . map_big_decimal_to_decimal128
Original file line number Diff line number Diff line change 142142 end
143143
144144 context "when provided a numeric" do
145- it "returns a string " do
145+ it "returns a BSON::Decimal128 " do
146146 expect ( described_class . evolve ( 1 ) ) . to eq ( BSON ::Decimal128 . new ( '1' ) )
147147 end
148148 end
149149
150- context "when provided a bogus value " do
151- it "returns the value " do
152- expect ( described_class . evolve ( :bogus ) ) . to eq ( :bogus )
150+ context "when provided a valid string " do
151+ it "returns a BSON::Decimal128 " do
152+ expect ( described_class . evolve ( "1" ) ) . to eq ( BSON :: Decimal128 . new ( '1' ) )
153153 end
154154 end
155155
159159 end
160160 end
161161
162- context "when provided a valid string " do
163- it "returns the string " do
164- expect ( described_class . evolve ( "1" ) ) . to eq ( "1" )
162+ context "when provided a bogus value " do
163+ it "returns the value " do
164+ expect ( described_class . evolve ( :bogus ) ) . to eq ( :bogus )
165165 end
166166 end
167167 end
You can’t perform that action at this time.
0 commit comments