Sha256: 13d563a133e3ea4e2c7d7ab8cd80699ec9d8b9a5657bbcde2102666d233b62ad
Contents?: true
Size: 651 Bytes
Versions: 15
Compression:
Stored size: 651 Bytes
Contents
class School < ApplicationRecord validates_presence_of :name validates_uniqueness_of :name strip_attributes has_many :questionnaires belongs_to :bus_list, optional: true def full_name out = "" out << name if full_location.present? out << " in " out << full_location end out end def full_location out = "" out << city if city.present? out << ", " if city.present? && state.present? out << state if state.present? out end def bus_list return unless bus_list_id BusList.find(bus_list_id) end def fips_code Fips.where(city: city, state: state).first end end
Version data entries
15 entries across 15 versions & 1 rubygems