Skip to content
This repository was archived by the owner on Aug 29, 2019. It is now read-only.
This repository was archived by the owner on Aug 29, 2019. It is now read-only.

Collection [] accessor not always working. #35

Description

@maxdupenois

When attempting to use the [] accessor on collection it will not always return the correct resource.
For example, when accessing lists:

api.account.lists[LIST_ID] #=> returns an empty resource
api.account.lists.find_by_id(LIST_ID) #=> returns the correct list

I suspect this is because the call to [] gives:

    def [](id)
      @entries[id] ||= fetch_entry(id)
    end
...
    def fetch_entry(id)
      @klass.new(client, get(path).merge(:parent => self))
    end

Where fetch_entry does not make use of the passed id, resulting in an empty resource.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions