Created
December 26, 2017 16:01
-
-
Save thiago-sydow/9ab2136a2028d9bea2c9f4c52b9170a4 to your computer and use it in GitHub Desktop.
Files used in the Medium post about Field Instrumentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersPolicy < ApplicationPolicy | |
class Scope < Scope | |
attr_reader :user, :scope | |
def initialize(user, scope) | |
@user = user | |
@scope = scope | |
end | |
def resolve | |
scope.where(team_id: user.team_id) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment