Class: State
- Inherits:
-
USA::Record
- Object
- ActiveRecord::Base
- USA::Record
- State
- Includes:
- USA::Seeded
- Defined in:
- app/models/state.rb
Overview
A state of the United States, or the District of Columbia.
Constant Summary
Constants included from USA::Seeded
Class Method Summary collapse
-
.recount_counties ⇒ void
Counts the counties of every state the count is wrong for, and touches none of the others.
Instance Method Summary collapse
-
#to_s ⇒ String
The default representation (used in views).
Methods inherited from USA::Record
Class Method Details
.recount_counties ⇒ void
This method returns an undefined value.
Counts the counties of every state the count is wrong for, and touches none of the others.
14 15 16 17 |
# File 'app/models/state.rb', line 14 def self.recount_counties where("counties_count <> (#{counted_counties})"). update_all [ "counties_count = (#{counted_counties}), updated_at = ?", Time.current ] end |
Instance Method Details
#to_s ⇒ String
Returns the default representation (used in views).
20 |
# File 'app/models/state.rb', line 20 def to_s = name |