Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No reverse relationship when using collection_of? #165

Open
yangtheman opened this issue Jun 17, 2013 · 0 comments
Open

No reverse relationship when using collection_of? #165

yangtheman opened this issue Jun 17, 2013 · 0 comments

Comments

@yangtheman
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant