Class: School

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/school.rb

Instance Method Summary collapse

Instance Method Details

#bus_listObject



23
24
25
26
# File 'app/models/school.rb', line 23

def bus_list
  return unless bus_list_id
  BusList.find(bus_list_id)
end

#fips_codeObject



28
29
30
# File 'app/models/school.rb', line 28

def fips_code
  Fips.where(city: city, state: state).first
end

#full_nameObject



11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/school.rb', line 11

def full_name
  out = ""
  out << name
  if city.present? || state.present?
    out << " in "
    out << city if city.present?
    out << ", " if city.present? && state.present?
    out << state if state.present?
  end
  out
end