class SelectTeamForm
Attributes
Public Instance Methods
Source
# File app/forms/select_team_form.rb, line 13 def save return false if invalid? team = teams.find(team_id) cis2_info.update!(team_workgroup: team.workgroup) unless Settings.cis2.enabled cis2_info.update!( organisation_code: team.organisation.ods_code, role_code: CIS2Info::NURSE_ROLES.first, workgroups: [team.workgroup] ) end true end
Source
# File app/forms/select_team_form.rb, line 31 def teams @teams ||= if Settings.cis2.enabled cis2_info.organisation.teams.where(workgroup: cis2_info.workgroups) else current_user.teams.includes(:organisation) end end