diff --git a/lib/spyke/http.rb b/lib/spyke/http.rb index fae8980..c3ff901 100644 --- a/lib/spyke/http.rb +++ b/lib/spyke/http.rb @@ -43,7 +43,7 @@ def uri(uri_template = nil) def send_request(method, path, params) connection.send(method) do |request| - if [:get, :delete].include?(method) + if method == :get path, params = merge_query_params(path, params) request.url path, params else diff --git a/lib/spyke/orm.rb b/lib/spyke/orm.rb index fe74b14..d7ecad6 100644 --- a/lib/spyke/orm.rb +++ b/lib/spyke/orm.rb @@ -71,8 +71,8 @@ def save end end - def destroy(params = {}) - self.attributes = delete(params) + def destroy + self.attributes = delete end def update(new_attributes) diff --git a/lib/spyke/version.rb b/lib/spyke/version.rb index 3d791ef..66423b3 100644 --- a/lib/spyke/version.rb +++ b/lib/spyke/version.rb @@ -1,3 +1,3 @@ module Spyke - VERSION = '7.2.1' + VERSION = '7.2.2' end diff --git a/test/orm_test.rb b/test/orm_test.rb index 0ec2823..2bf216c 100644 --- a/test/orm_test.rb +++ b/test/orm_test.rb @@ -168,14 +168,6 @@ def test_to_params_with_custom_root assert_equal({ 'foto' => { 'url' => 'bob.jpg' } }, Cookbook::Photo.new(url: 'bob.jpg').to_params) end - def test_destroy_with_params - endpoint = stub_request(:delete, 'http://sushi.com/recipes/1?cascade=true').to_return_json(result: { id: 1, deleted: true }) - recipe = Recipe.new(id: 1) - recipe.destroy(cascade: true) - assert recipe.deleted - assert_requested endpoint - end - def test_destroy endpoint = stub_request(:delete, 'http://sushi.com/recipes/1').to_return_json(result: { id: 1, deleted: true }) recipe = Recipe.new(id: 1)