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

Open
matthewford opened this Issue Oct 5, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@matthewford
Copy link

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

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.
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.