Class: School

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

Instance Method Summary collapse

Instance Method Details

#fips_codeObject



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

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

#full_locationObject



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

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

#full_nameObject



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

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