-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
see a code example:
There are three models , as this:
class User include Mongoid::Document embeds_many :projects end class Project embedded_in :user embeds_many :tasks end class Task embedded_in :project end
Now create them to use:
user = User.new project = Project.new task = Task.new project.tasks << task user.projects << project user.save
Then query:
{{user.reload.projects[0].tasks }}
output
[] !!
I hope it should output [task]
I found this describe about this:
Append one or many child addresses, saving them if the person is persisted
Thx.