Skip to content

Context not available in relationship request #763

@koraykoska

Description

@koraykoska

If we do a Request like /posts/1/tags and filter these tags with ?filter[name]=green, the context is not available within this apply block for the filter. If I request /tags and apply the same filter, the response is exactly what I expect.

Is this behaviour expected? Could we get somehow around this?

Example filter:

filter :name, apply: -> (records, value, _options) {
  return records.where(name: value) if self.context[:current_user].guest == false
  return records.where(name: 'yellow')
}

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