-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.2.0, 6.4.1, 7.0.1
-
Component/s: None
-
None
-
Environment:Ruby 2.4
Rails 5.1
I have model with BigDecimal field:
class Invoice
field :amount, type: BigDecimal
end
The following test does not pass:
let!(:invoice) { create :invoice, amount: 10.0 }
subject { Invoice.where amount: { '$gt': 0 } }
it { is_expected.to include invoice }
I think that this is due to the fact that 0 converted to string "0" for query.
Invoice.where(amount: { '$gt': 0 }).selector # => {"balance"=>{"$gte"=>"0"}}
- is depended on by
-
MONGOID-4600 Release Mongoid 7.0.2
- Closed