class TeamLocation
Schema Information
Table name: team_locations
id :bigint not null, primary key academic_year :integer not null created_at :datetime not null updated_at :datetime not null location_id :bigint not null subteam_id :bigint team_id :bigint not null
Indexes
idx_on_team_id_academic_year_location_id_1717f14a0c (team_id,academic_year,location_id) UNIQUE index_team_locations_on_location_id (location_id) index_team_locations_on_subteam_id (subteam_id) index_team_locations_on_team_id (team_id)
Foreign Keys
fk_rails_... (location_id => locations.id) fk_rails_... (subteam_id => subteams.id) fk_rails_... (team_id => teams.id)
Public Instance Methods
Source
# File app/models/team_location.rb, line 51 def email = subteam&.email || team&.email def name = subteam&.name || team&.name def phone = subteam&.phone || team&.phone def phone_instructions = subteam&.phone_instructions || team&.phone_instructions def safe_to_destroy? !sessions.exists? && !consent_forms.exists? && !patient_locations.exists? end private def subteam_belongs_to_team errors.add(:subteam, :inclusion) if subteam && subteam.team_id != team.
Source
# File app/models/team_location.rb, line 53 def name = subteam&.name || team&.name def phone = subteam&.phone || team&.phone def phone_instructions = subteam&.phone_instructions || team&.phone_instructions def safe_to_destroy? !sessions.exists? && !consent_forms.exists? && !patient_locations.exists? end private def subteam_belongs_to_team errors.add(:subteam, :inclusion) if subteam && subteam.team_id != team.id
Source
# File app/models/team_location.rb, line 55 def phone = subteam&.phone || team&.phone def phone_instructions = subteam&.phone_instructions || team&.phone_instructions def safe_to_destroy? !sessions.exists? && !consent_forms.exists? && !patient_locations.exists? end private def subteam_belongs_to_team errors.add(:subteam, :inclusion) if subteam && subteam.team_id != team.id end
Source
# File app/models/team_location.rb, line 57 def phone_instructions = subteam&.phone_instructions || team&.phone_instructions def safe_to_destroy? !sessions.exists? && !consent_forms.exists? && !patient_locations.exists? end private def subteam_belongs_to_team errors.add(:subteam, :inclusion) if subteam && subteam.team_id != team.id end end
Source
# File app/models/team_location.rb, line 60 def safe_to_destroy? !sessions.exists? && !consent_forms.exists? && !patient_locations.exists? end
Source
# File app/models/team_location.rb, line 66 def subteam_belongs_to_team errors.add(:subteam, :inclusion) if subteam && subteam.team_id != team.id end