Sha256: 89555ab0c84a6d5bcc32aba27dab47b01e11bf68ef4214584abd47663a653f85
Contents?: true
Size: 669 Bytes
Versions: 13
Compression:
Stored size: 669 Bytes
Contents
# frozen_string_literal: true module ThinkFeelDoEngine # Labels the sender and recipient of a message. module Addressable def from(user = nil) if sender.id == user.try(:id) "You" elsif sender.try(:study_id) sender.study_id elsif recipient.try(:active_group).try(:arm).try(:has_woz?) "Moderator" else "Coach" end end def to(user = nil) if recipient.id == user.try(:id) "You" elsif recipient.try(:study_id) recipient.study_id elsif sender.try(:active_group).try(:arm).try(:has_woz?) "Moderator" else "Coach" end end end end
Version data entries
13 entries across 13 versions & 1 rubygems