Skip to content

Commit

Permalink
fix unparsed values on save after array operations, fix decrement, re…
Browse files Browse the repository at this point in the history
…move unnecessary object cache/restore around saves since they don't mutate self anyways except array operations which we actually want to come back as real server value and not a mix of pointers and objects
  • Loading branch information
ericcj committed May 21, 2013
1 parent 167aa57 commit e1d1262
Show file tree
Hide file tree
Showing 10 changed files with 352 additions and 127 deletions.
22 changes: 11 additions & 11 deletions README.md
Expand Up @@ -183,7 +183,7 @@ game_score["score"] = Parse::Increment.new(1)
game_score.save
```

You can also use `Parse::Decrement.new(amount)`.
You can also use a negative amount to decrement.

#### Arrays

Expand Down Expand Up @@ -247,7 +247,7 @@ You can delete a single field from an object by using the `Parse::Object#delete_

To reduce the amount of time spent on network round trips, you can create, update, or delete several objects in one call, using the batch endpoint.

parse-ruby-client provides a "manual" way to construct Batch Operations, as well as some convenience methods. The commands are run in the order they are given. For example, to create a couple of GameScore objects using the "manual" style, use `Parse::Batch#add_request`. `#add_request` takes a `Hash` with `"method"`, `"path"`, and `"body"` keys that specify the HTTP command that would normally be used for that command.
parse-ruby-client provides a "manual" way to construct Batch Operations, as well as some convenience methods. The commands are run in the order they are given. For example, to create a couple of GameScore objects using the "manual" style, use `Parse::Batch#add_request`. `#add_request` takes a `Hash` with `"method"`, `"path"`, and `"body"` keys that specify the HTTP command that would normally be used for that command.

```ruby
batch = Parse::Batch.new
Expand Down Expand Up @@ -458,7 +458,7 @@ Other constraint methods include:
<tr>
<td>`Parse::Query#select`</td>
<td>TODO: `$select` not yet implemented. This matches a value for a key in the result of a different query</td>
</tr>
</tr>
</table>

For example, to retrieve scores between 1000 and 3000, including the endpoints, we could issue:
Expand Down Expand Up @@ -704,7 +704,7 @@ To sign up a new user, create a new `Parse::User` object and then call `#save` o

```ruby
user = Parse::User.new({
:username => "cooldude6",
:username => "cooldude6",
:password => "p_n7!-e8",
:phone => "415-392-0202"
})
Expand Down Expand Up @@ -828,7 +828,7 @@ All of the options for queries that work for regular objects also work for user

### Deleting Users

TODO: Implement this!
TODO: Implement this!

Proposed api:

Expand Down Expand Up @@ -1014,8 +1014,8 @@ To upload a file to Parse, use `Parse::File`. You must include the `"Content-Typ

```ruby
file = Parse::File.new({
:body => "Hello World!",
:local_filename => "hello.txt",
:body => "Hello World!",
:local_filename => "hello.txt",
:content_type => "text/plain"
})
file.save
Expand All @@ -1033,8 +1033,8 @@ To upload an image, the syntax is a little bit different. Here's an example that

```ruby
photo = Parse::File.new({
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:content_type => "image/jpeg"
})
photo.save
Expand All @@ -1046,8 +1046,8 @@ After files are uploaded, you can associate them with Parse objects:

```ruby
photo = Parse::File.new({
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:content_type => "image/jpeg"
})
photo.save
Expand Down
22 changes: 11 additions & 11 deletions features.md
Expand Up @@ -179,7 +179,7 @@ game_score["score"] = Parse::Increment.new(1)
game_score.save
```

You can also use `Parse::Decrement.new(amount)`.
Use a negative amount to decrement.

#### Arrays

Expand Down Expand Up @@ -243,7 +243,7 @@ You can delete a single field from an object by using the `Parse::Object#delete_

To reduce the amount of time spent on network round trips, you can create, update, or delete several objects in one call, using the batch endpoint.

parse-ruby-client provides a "manual" way to construct Batch Operations, as well as some convenience methods. The commands are run in the order they are given. For example, to create a couple of GameScore objects using the "manual" style, use `Parse::Batch#add_request`. `#add_request` takes a `Hash` with `"method"`, `"path"`, and `"body"` keys that specify the HTTP command that would normally be used for that command.
parse-ruby-client provides a "manual" way to construct Batch Operations, as well as some convenience methods. The commands are run in the order they are given. For example, to create a couple of GameScore objects using the "manual" style, use `Parse::Batch#add_request`. `#add_request` takes a `Hash` with `"method"`, `"path"`, and `"body"` keys that specify the HTTP command that would normally be used for that command.

```ruby
batch = Parse::Batch.new
Expand Down Expand Up @@ -454,7 +454,7 @@ Other constraint methods include:
<tr>
<td>`Parse::Query#select`</td>
<td>TODO: `$select` not yet implemented. This matches a value for a key in the result of a different query</td>
</tr>
</tr>
</table>

For example, to retrieve scores between 1000 and 3000, including the endpoints, we could issue:
Expand Down Expand Up @@ -700,7 +700,7 @@ To sign up a new user, create a new `Parse::User` object and then call `#save` o

```ruby
user = Parse::User.new({
:username => "cooldude6",
:username => "cooldude6",
:password => "p_n7!-e8",
:phone => "415-392-0202"
})
Expand Down Expand Up @@ -824,7 +824,7 @@ All of the options for queries that work for regular objects also work for user

### Deleting Users

TODO: Implement this!
TODO: Implement this!

Proposed api:

Expand Down Expand Up @@ -1010,8 +1010,8 @@ To upload a file to Parse, use `Parse::File`. You must include the `"Content-Typ

```ruby
file = Parse::File.new({
:body => "Hello World!",
:local_filename => "hello.txt",
:body => "Hello World!",
:local_filename => "hello.txt",
:content_type => "text/plain"
})
file.save
Expand All @@ -1029,8 +1029,8 @@ To upload an image, the syntax is a little bit different. Here's an example that

```ruby
photo = Parse::File.new({
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:content_type => "image/jpeg"
})
photo.save
Expand All @@ -1042,8 +1042,8 @@ After files are uploaded, you can associate them with Parse objects:

```ruby
photo = Parse::File.new({
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:content_type => "image/jpeg"
})
photo.save
Expand Down
180 changes: 180 additions & 0 deletions fixtures/vcr_cassettes/test_array_add_unique.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1d1262

Please sign in to comment.