adelevie / parse_resource

A Ruby wrapper for Parse.com's REST API
MIT License
244 stars 101 forks source link

Can associations still be used? #122

Open andyxhadji opened 10 years ago

andyxhadji commented 10 years ago

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 commented 10 years ago

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

andyxhadji commented 10 years ago

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 commented 10 years ago

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