-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
class Doc
embeds_many :foo
class Foo
mydate type: DateTime
This raises error
my_doc = Doc.find(id)
my_doc = Doc.where(:"foo.mydate".gte => now).find(id)
undefined method `>=' for [2013-08-03 23:00:00 UTC, 2013-08-03 00:00:00 UTC]:Array
mongoid (2.4.12) lib/mongoid/matchers/default.rb:66:in `determine'
This works
my_doc = Doc.where(:"foo.mydate".gte => now).find(id)
So if I've used a find before the criteria doesn't work but removing the first find solkves the issue. I need though to be able to run the same query twice.