Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

integrate nil value key deletion with safe_hash instead of having the relation part there and the deletion part in as_json since using parse-ruby-client with active_support can clobber Parse::Object#as_json. also raise on nested unsaved objects instead o #91

Merged
merged 20 commits into from Aug 15, 2013

Conversation

Projects
None yet
3 participants
Contributor

ericcj commented May 22, 2013

also prefer the ruby to_h convention to the rails as_json one but support both.

also make sure bad query responses raise instead of slip through as strings

ericcj added some commits May 22, 2013

@ericcj ericcj integrate nil value key deletion with safe_hash instead of having the…
… relation part there and the deletion part in as_json since using parse-ruby-client with active_support can clobber Parse::Object#as_json
ce1e916
@ericcj ericcj remove logging f7e04b0
@ericcj ericcj Merge remote-tracking branch 'adelevie/master' 735ac0b
Contributor

bcherry commented May 22, 2013

nice, lgtm

@ericcj ericcj raise on nested new objects instead of silently just not saving them …
…since REST api doesn't support it, circular saves are impossible
653145a
Contributor

bcherry commented May 22, 2013

new stuff looks good too

Contributor

bcherry commented May 24, 2013

nice

@bcherry bcherry commented on an outdated diff May 24, 2013

lib/parse/query.rb
@@ -125,7 +125,12 @@ def get
[:count, :limit, :skip, :include].each {|a| merge_attribute(a, query)}
Parse.client.logger.info{"Parse query for #{uri} #{CGI.unescape(query.inspect)}"}
response = Parse.client.request uri, :get, nil, query
- Parse.parse_json class_name, response
+
+ if response.is_a?(Hash) && response.has_key?(Protocol::KEY_RESULTS) && response[Protocol::KEY_RESULTS].is_a?(Array)
+ response[Protocol::KEY_RESULTS].map{|o| Parse.parse_json(class_name, o)}
@bcherry

bcherry May 24, 2013

Contributor

this breaks count queries.... will fix, but don't merge this in the meantime

@bcherry

bcherry May 24, 2013

Contributor

fixed in 7aaed38

Contributor

ericcj commented May 27, 2013

looks good ben, thanks. this restores the previous behavior which makes it safe to merge. i also wrote a story to make count clearer: #93

Contributor

ericcj commented Jun 4, 2013

@adelevie mind taking a look at this to merge? these are reasonably important bug fixes that we've been running in production

Contributor

bcherry commented Jun 6, 2013

One more thing (ericcj#1) that just appeared in this pull: Now automatically converting HTTP GET into a POST with X-HTTP-Method-Override=GET when the query is large (e.g. very large $in query) to avoid URL-length limits.

Contributor

ericcj commented Jun 24, 2013

@adelevie this pull request contains some significant bug fixes we should try to get into the gem

@adelevie adelevie added a commit that referenced this pull request Aug 15, 2013

@adelevie adelevie Merge pull request #91 from ericcj/master
integrate nil value key deletion with safe_hash instead of having the relation part there and the deletion part in as_json since using parse-ruby-client with active_support can clobber Parse::Object#as_json.  also raise on nested unsaved objects instead o
0eb452b

@adelevie adelevie merged commit 0eb452b into adelevie:master Aug 15, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment