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

@maxdupenois

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.

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