class PostPolicy < ApplicationPolicy class Scope < Struct.new(:user, :scope) def resolve scope end end def update? record.author == user end def destroy? update? end end