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

Plans to support belongs to and has many through? #20

Closed
matthewford opened this issue Oct 5, 2018 · 1 comment
Closed

Plans to support belongs to and has many through? #20

matthewford opened this issue Oct 5, 2018 · 1 comment

Comments

@matthewford
Copy link

@matthewford matthewford commented Oct 5, 2018

Hello,

Thanks for the gem are there any plans to support belongs to or has_many through associations?

@daniel-rikowski
Copy link

@daniel-rikowski daniel-rikowski commented Nov 1, 2018

I just hacked together an implementation for belongs_to:

https://gist.github.com/daniel-rikowski/790e07db36a00925f653714f9c66f20c

Caution: It was rather easy, so it's quite possible I missed something important.

Usage: include_belongs_to :author

If you need has_many through you can just clone the through association (the one without the through option). Unfortunately you have to save and reload the model in order to update the parent association (the one with the through option)

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

Successfully merging a pull request may close this issue.

None yet
2 participants