-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I believe .timeless is improperly scoped.
ruby require 'spec_helper' class Chicken include Mongoid::Document include Mongoid::Timestamps after_save :lay_egg def lay_egg Egg.create! end end class Egg include Mongoid::Document include Mongoid::Timestamps end describe Mongoid do it "works" do Chicken.create! Egg.count.should == 1 Egg.last.created_at.should_not be_nil end it "doesn't work" do Chicken.timeless.create! Egg.count.should == 1 Egg.last.created_at.should_not be_nil end end
When a chicken lays an egg, you would expect the egg to have a timestamp, even if the chicken doesn't have one.