Skip to content

where mutates original #254

@AlexParamonov

Description

@AlexParamonov

where method should not do any mutation. New object have to be returned back.

so far hotfixed with:

JsonApiClient::Query::Builder.prepend(
  Module.new do
    def where(conditions = {})
      dup.tap do |clone|
        clone.instance_variable_set(:@path_params, @path_params.merge(conditions.slice(*klass.prefix_params)))
        clone.instance_variable_set(:@filters, @filters.merge(conditions.except(*klass.prefix_params)))
      end
    end
  end
)

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