philomena/lib/philomena/comments/attribution.ex

14 lines
332 B
Elixir
Raw Normal View History

2019-11-11 17:56:34 +01:00
defimpl Philomena.Attribution, for: Philomena.Comments.Comment do
def object_identifier(comment) do
to_string(comment.image_id || comment.id)
end
def best_user_identifier(comment) do
to_string(comment.user_id || comment.fingerprint || comment.ip)
end
def anonymous?(comment) do
!!comment.anonymous
end
2020-01-11 05:20:19 +01:00
end