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

Can associations still be used? #122

Open
andyxhadji opened this issue May 6, 2014 · 3 comments
Open

Can associations still be used? #122

andyxhadji opened this issue May 6, 2014 · 3 comments

Comments

@andyxhadji
Copy link

Is it still possible to, for example, search for a list of objects where the user is a User object? If so, does anyone have a code sample of their own project they can share as an example?

@sbonami
Copy link
Contributor

sbonami commented May 7, 2014

Do you mean something similar to this: Post.where(user: current_user.to_pointer).execute?

@andyxhadji
Copy link
Author

Exactly, and also is there an example saving objects with the User as an author of a Post? I'm trying to find methods that could help me out, but I'm very new to parse_resource . Thanks for the help

@sbonami
Copy link
Contributor

sbonami commented May 8, 2014

I haven't used parse_resource in a few months but this should work:

post = Post.find(1)
author = Author.find(1)
post.author = author

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