Class: Arm

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/arm.rb

Overview

These arms are part of the adolescent and adult projects Between 1 and 8 groups are in each arm and each group could have between 1 and 10 or so participants

Instance Method Summary collapse

Instance Method Details

#display_name_required_for_membership?(participant, display_name) ⇒ Boolean



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/models/arm.rb', line 18

def display_name_required_for_membership?(participant, display_name)
  if social? && display_name.empty?
    participant.errors.add(
      :display_name, "is required because the arm of this \
        intervention utilizes social features or the \
        participant is currently enrolled in an arm that \
        requires a display name."
      )
    false
  else
    true
  end
end

#non_home_toolsObject



40
41
42
43
44
45
46
# File 'app/models/arm.rb', line 40

def non_home_tools
  tools = BitCore::Tool.arel_table
  bit_core_tools
    .where(tools[:type].eq(nil)
      .or(tools[:type].not_eq("Tools::Home"))
    )
end

#social?Boolean



32
33
34
# File 'app/models/arm.rb', line 32

def social?
  is_social
end

#woz?Boolean



36
37
38
# File 'app/models/arm.rb', line 36

def woz?
  has_woz
end