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)


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

Returns:

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

Returns:

  • (Boolean)


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

def 
  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

Returns:

  • (Boolean)


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

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