-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
This problem exists only in Mongoid 3 (testing on 3.0.15). Mongoid 2 doesn't have the problem.
Region has_one slug.
foo = Region.new
foo.build_slug
MOPED: 127.0.0.1:27017 QUERY database=cms_engine_test collection=regions selector={"$query"=>
foo.build_slug
MOPED: 127.0.0.1:27017 QUERY database=cms_engine_test collection=regions selector={"$query"=>{"_id"=>"50d1b0ed5b9e05c34300000d"}
, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 fields=nil (0.2720ms)
If the region is already saved, then there is no such request.
The same happens during assignments:
e = Slug.new
foo.slug = e
MOPED: 127.0.0.1:27017 QUERY database=cms_engine_test collection=regions selector={"$query"=>
, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 fields=nil (0.5631ms)