Class: User
Overview
A person with some authoritative role (a non-Participant).
Constant Summary
ThinkFeelDoEngine::Concerns::ValidatePassword::WEAK_PASSWORD_MESSAGE
Instance Method Summary
collapse
Instance Method Details
#admin? ⇒ Boolean
41
42
43
|
# File 'app/models/user.rb', line 41
def admin?
is_admin
end
|
#build_sent_message(attributes = {}) ⇒ Object
33
34
35
|
# File 'app/models/user.rb', line 33
def build_sent_message(attributes = {})
sent_messages.build(attributes)
end
|
#coach? ⇒ Boolean
45
46
47
|
# File 'app/models/user.rb', line 45
def coach?
user_roles.map(&:role_class_name).include?("Roles::Clinician")
end
|
#content_author? ⇒ Boolean
53
54
55
|
# File 'app/models/user.rb', line 53
def content_author?
user_roles.map(&:role_class_name).include?("Roles::ContentAuthor")
end
|
#participants_for_group(group) ⇒ Object
37
38
39
|
# File 'app/models/user.rb', line 37
def participants_for_group(group)
participants.where(id: group.participant_ids)
end
|
#researcher? ⇒ Boolean
49
50
51
|
# File 'app/models/user.rb', line 49
def researcher?
user_roles.map(&:role_class_name).include?("Roles::Researcher")
end
|