couchrest/couchrest — pull request #93 by NiDi (2013-02-19 09:30:17+00:00)
Title: Allow json object decoding on get requests

This Pull Request refers to https://github.com/couchrest/couchrest/issues/92

Since http://seclists.org/oss-sec/2013/q1/283 the json gem doesn't allow object decoding by default. Gems, such as CouchPotato, are based on this mechanism. This commit allows to decide on every GET request to turn object decoding back on.

```ruby
class TestObject
def self.json_create(args)
new
end
end

# Given you have the following json document stored in your couchdb
# {'_id' => "42", JSON.create_id => 'TestObject'}

CouchRest.new('http://mydburl').database('test').get("42", :decode_object => true).class

# => TestObject

```
It also updates gem dependencies to safe gem versions.