Sha256: 6186edd260a87b121fe725c6cf566d6684068f074eb3610c3d68bc803155dd91
Contents?: true
Size: 523 Bytes
Versions: 30
Compression:
Stored size: 523 Bytes
Contents
class BusList < ApplicationRecord validates_presence_of :name validates_uniqueness_of :name has_many :schools strip_attributes def full? passengers.count >= capacity end def passengers Questionnaire.joins(:school).where("schools.bus_list_id = '#{id}' AND acc_status = 'rsvp_confirmed' AND riding_bus = true").order("schools.name ASC, last_name ASC") end def checked_in_passengers passengers.select(&:checked_in?) end def captains passengers.where(is_bus_captain: true) end end
Version data entries
30 entries across 30 versions & 1 rubygems