-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
I have an embedded 1 to many relationship that looks like the following:
class A include Mongoid::Documents embeds_many :bs end class B embedded_in :a field :h, type: Hash end
When I call the following:
a = A.new a.bs.find_or_create_by(h: {key: "value"}) a.bs.find_or_create_by(h: {key: "some other value"})
the first call is successful, but the second call gives me:
NoMethodError: undefined method `new' for nil:NilClass