Class: School

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

Instance Method Summary collapse

Instance Method Details

#bus_listObject



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

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

#fips_codeObject



34
35
36
# File 'app/models/school.rb', line 34

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

#full_locationObject



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

def full_location
  out = ""
  out << city if city.present?
  out << ", " if city.present? && state.present?
  out << state if state.present?
  out
end

#full_nameObject



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

def full_name
  out = ""
  out << name
  if full_location.present?
    out << " in "
    out << full_location
  end
  out
end