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

Removed extra loop in batch operation #99

Merged
merged 3 commits into from Aug 15, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions README.md
Expand Up @@ -273,15 +273,11 @@ batch.run!
Because manually constructing `"path"` values is repetitive, you can use `Parse::Batch#create_object`, `Parse::Batch#update_object`, and `Parse::Batch#delete_object`. Each of these methods takes an instance of `Parse::Object` as the only argument. Then you just call `Parse::Batch#run!`. For example:

```ruby
# making a few GameScore objects
game_scores = [1, 2, 3, 4, 5].map do |i|
batch = Parse::Batch.new
# making a few GameScore objects and adding them to the batch operation.
[1, 2, 3, 4, 5].each do |i|
gs = Parse::Object.new("GameScore")
gs["score"] = "#{i}"
gs
end

batch = Parse::Batch.new
game_scores.each do |gs|
batch.create_object(gs)
end
batch.run!
Expand Down