Skip to content

Instantly share code, notes, and snippets.

@thiago-sydow
Created December 26, 2017 16:01
Show Gist options
  • Save thiago-sydow/9ab2136a2028d9bea2c9f4c52b9170a4 to your computer and use it in GitHub Desktop.
Save thiago-sydow/9ab2136a2028d9bea2c9f4c52b9170a4 to your computer and use it in GitHub Desktop.
Files used in the Medium post about Field Instrumentation
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