You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using has_many and belongs_to relationship in ActiveModel, having one relationship means reverse is automatically created. For example, if I have a has_many :bs and b belongs_to :a, I could find b's using a.bs and a using b.a.
However, it CouchRest Model, it doesn't seem to be the case, so I would need to set the reverse relationship explicitly. For example, if I have a collection_of :bs and b belongs_to :a, I would have to explicitly say b.a = a after I create a with a bunch of b's.
Is this correct? I just want to make sure I am not missing some obvious way to establish has_many and belongs_to relationship in CouchRest Model.
The text was updated successfully, but these errors were encountered:
When using has_many and belongs_to relationship in ActiveModel, having one relationship means reverse is automatically created. For example, if I have
a has_many :bs
andb belongs_to :a
, I could find b's usinga.bs
and a usingb.a
.However, it CouchRest Model, it doesn't seem to be the case, so I would need to set the reverse relationship explicitly. For example, if I have
a collection_of :bs
andb belongs_to :a
, I would have to explicitly sayb.a = a
after I create a with a bunch of b's.Is this correct? I just want to make sure I am not missing some obvious way to establish has_many and belongs_to relationship in CouchRest Model.
The text was updated successfully, but these errors were encountered: