We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Based on #192.
Let's make it possible using callable objects to extract scope implementations:
class ProjectPolicy < ApplicationPolicy relation_scope AuthorizedProjects # similar to relation_scope do |relation| AuthorizedProjects.call(relation) end end
Let's update the .scope_for method to handle both blocks and callable objects, so, the new method definition would look like
.scope_for
def scope_for(type, name = :default, callable = nil, &block) end
The text was updated successfully, but these errors were encountered:
Allow using callable objects as scopes palkan#261
670f557
Allow using callable objects as scopes #261
a635104
Closed by #263
Sorry, something went wrong.
No branches or pull requests
Context
Based on #192.
Let's make it possible using callable objects to extract scope implementations:
TODO
Let's update the
.scope_for
method to handle both blocks and callable objects, so, the new method definition would look likeThe text was updated successfully, but these errors were encountered: