Retrospring/app/policies/answer_policy.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
229 B
Ruby
Raw Normal View History

2023-02-10 02:34:55 -08:00
# frozen_string_literal: true
class AnswerPolicy
attr_reader :user, :answer
def initialize(user, answer)
@user = user
@answer = answer
end
def pin? = answer.user == user
def unpin? = answer.user == user
end