-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Hi.
I just found strange behaviour in my mongoid application.
class User
include Mongoid::Document
has_many :foos
end
class Foo
include Mongoid::Document
belongs_to :user
field :name
end
And then in console:
@user = User.first
@foo = Foo.new
@foo.name = "asd"
@foo.user = @user
@foo.save
@user.foos
=> []
@user = User.first
@user.foos
=> [foo object]
I'm not using any cache methods/gems etc. Is this normal behaviour?
I'm using rails 3.1 stable, ruby 1.9.2p136, latest mongoid and bson_ext