Skip to content

Commit

Permalink
Merge pull request #6 from amcaplan/reorder-delegation
Browse files Browse the repository at this point in the history
Actually put Array at the bottom of the list for method delegation
  • Loading branch information
amcaplan committed Aug 13, 2018
2 parents 1942e6a + ef13c91 commit 2dc3cc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/simple_jsonapi_client/redirection/fetch_all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
module SimpleJSONAPIClient
module Redirection
class FetchAll < ::SimpleJSONAPIClient::Redirection::Proxy
def_delegators :internal_object, *(Array.instance_methods(false) - instance_methods)
def_delegators :internal_enumerator, *(Enumerator.instance_methods(false) - instance_methods)
def_delegators :internal_enumerator, *(Enumerable.instance_methods(false) - instance_methods)
def_delegators :internal_object, :size, *(Array.instance_methods(false) - instance_methods)

def initialize(base_opts, &operation)
@base_opts = base_opts
Expand Down
2 changes: 1 addition & 1 deletion lib/simple_jsonapi_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SimpleJSONAPIClient
VERSION = "0.2.1"
VERSION = "0.2.2"
end
4 changes: 2 additions & 2 deletions spec/integration/read_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def name
let(:returned_authors) { fetch_authors(includes: ['posts.comments']) }

it 'uses includes to avoid new HTTP requests' do
returned_authors.first
author = returned_authors.first
expect(connection).not_to receive(:get)
expect(returned_authors.first.posts.first.comments.first.text).to eq(comments.first.text)
expect(author.posts.first.comments.first.text).to eq(comments.first.text)
end
end
end
Expand Down

0 comments on commit 2dc3cc7

Please sign in to comment.