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
40
41
42
|
# File 'app/models/user.rb', line 40
def admin?
is_admin
end
|
#build_sent_message(attributes = {}) ⇒ Object
32
33
34
|
# File 'app/models/user.rb', line 32
def build_sent_message(attributes = {})
sent_messages.build(attributes)
end
|
#coach? ⇒ Boolean
44
45
46
|
# File 'app/models/user.rb', line 44
def coach?
user_roles.map(&:role_class_name).include?("Roles::Clinician")
end
|
#content_author? ⇒ Boolean
52
53
54
|
# File 'app/models/user.rb', line 52
def content_author?
user_roles.map(&:role_class_name).include?("Roles::ContentAuthor")
end
|
#participants_for_group(group) ⇒ Object
36
37
38
|
# File 'app/models/user.rb', line 36
def participants_for_group(group)
participants.where(id: group.participant_ids)
end
|
#researcher? ⇒ Boolean
48
49
50
|
# File 'app/models/user.rb', line 48
def researcher?
user_roles.map(&:role_class_name).include?("Roles::Researcher")
end
|