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

polymorphic associations #28

Open
elfassy opened this issue Apr 8, 2015 · 1 comment
Open

polymorphic associations #28

elfassy opened this issue Apr 8, 2015 · 1 comment

Comments

@elfassy
Copy link
Contributor

elfassy commented Apr 8, 2015

Is there a way to make a polymophic association? Something like: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations

For now i'm doing something like

  votes: ->
    Vote.find(
      votable_id: @id, 
      votable_type: "answer"
    )

thanks

@kaptron
Copy link
Contributor

kaptron commented Apr 9, 2015

Good idea, that's not currently something that's been implemented. If you want to take a stab at adding it to the codebase yourself that would be great, I'd be happy to merge a pull request -- otherwise I'll have to get back to you on implementing that once I've had some time to look into it. It seems like you have a totally usable workaround so hopefully that's good enough for now.

@elfassy elfassy changed the title polymophic associations polymorphic associations Apr 9, 2015
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

2 participants