retrospring/app/policies/answer_policy.rb
2023-02-12 20:19:50 +01:00

14 lines
229 B
Ruby

# 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