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')
}
If we do a Request like
/posts/1/tagsand filter these tags with?filter[name]=green, thecontextis not available within thisapplyblock for the filter. If I request/tagsand apply the same filter, the response is exactly what I expect.Is this behaviour expected? Could we get somehow around this?
Example filter: