Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ThinkFeelDoEngine::Concerns::ValidatePassword
Defined in:
app/models/user.rb

Overview

A person with some authoritative role (a non-Participant).

Constant Summary

Constants included from ThinkFeelDoEngine::Concerns::ValidatePassword

ThinkFeelDoEngine::Concerns::ValidatePassword::WEAK_PASSWORD_MESSAGE

Instance Method Summary collapse

Instance Method Details

#admin?Boolean

Returns:

  • (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

Returns:

  • (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

Returns:

  • (Boolean)


53
54
55
# File 'app/models/user.rb', line 53

def 
  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

Returns:

  • (Boolean)


49
50
51
# File 'app/models/user.rb', line 49

def researcher?
  user_roles.map(&:role_class_name).include?("Roles::Researcher")
end