Skip to content
Browse files

added ParseResource::Base#include_object example

  • Loading branch information...
1 parent 416282e commit 50963cfcf1316bfca5fefece7c0142aa64fc0b7d @adelevie committed Jan 3, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 README.md
View
9 README.md
@@ -211,8 +211,15 @@ author.posts << post2
post3 = Post.create(:title => "Goosebumps 3")
post3.author = author
post3.save
-```
+# relational queries
+posts = Post.include_object(:author).all
+posts.each do |post|
+ puts post.title
+ # because you used Post#include_object, calling post.title won't execute a new query
+ # this is similar to ActiveRecord's eager loading
+end
+```
Documentation
-------------

0 comments on commit 50963cf

Please sign in to comment.
Something went wrong with that request. Please try again.