Skip to content

Provide options context to apply_filter#238

Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
john-griffin:filter-context
Jun 5, 2015
Merged

Provide options context to apply_filter#238
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
john-griffin:filter-context

Conversation

@john-griffin
Copy link
Copy Markdown
Contributor

Overriding apply_filter is the recommended way to implement custom
filters. However if filtering relies on the context (e.g. current_user)
it was not possible to implement the custom filter. This passes the
options context to the apply_filter method so it is available when
overriding in a resource.

Overriding apply_filter is the recommended way to implement custom 
filters. However if filtering relies on the context (e.g. current_user)
it was not possible to implement the custom filter. This passes the 
options context to the apply_filter method so it is available when 
overriding in a resource.
@john-griffin
Copy link
Copy Markdown
Contributor Author

Tests passing now.

@barelyknown
Copy link
Copy Markdown
Collaborator

Good catch.

lgebhardt added a commit that referenced this pull request Jun 5, 2015
Provide options context to apply_filter
@lgebhardt lgebhardt merged commit 31ec9f5 into JSONAPI-Resources:master Jun 5, 2015
@lgebhardt
Copy link
Copy Markdown
Contributor

Good catch. Thanks!

@john-griffin john-griffin deleted the filter-context branch June 5, 2015 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants