Class: USGeo::BaseRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- USGeo::BaseRecord
- Defined in:
- lib/us_geo/base_record.rb
Overview
Base class that all models inherit from.
Direct Known Subclasses
CombinedStatisticalArea, CoreBasedStatisticalArea, County, CountySubdivision, Division, MetropolitanDivision, Place, PlaceCounty, Region, State, UrbanArea, UrbanAreaCounty, UrbanAreaCountySubdivision, Zcta, ZctaCounty, ZctaCountySubdivision, ZctaMapping, ZctaPlace, ZctaUrbanArea
Constant Summary collapse
- STATUS_IMPORTED =
1- STATUS_REMOVED =
-1
- STATUS_MANUAL =
0
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#imported? ⇒ Boolean
Return true if the record was imported from the data source distributed with the gem.
-
#manual? ⇒ Boolean
Return true if the record was manually added to the database.
-
#removed? ⇒ Boolean
Return true if the record was removed from the data source distributed with the gem.
Instance Attribute Details
#status ⇒ Integer
|
|
# File 'lib/us_geo/base_record.rb', line 91
|
#updated_at ⇒ Time
|
|
# File 'lib/us_geo/base_record.rb', line 94
|
Class Method Details
.load!(location = nil) ⇒ Object
24 25 26 |
# File 'lib/us_geo/base_record.rb', line 24 def load!(location = nil) raise NotImplementedError end |
Instance Method Details
#imported? ⇒ Boolean
Return true if the record was imported from the data source distributed with the gem.
100 101 102 |
# File 'lib/us_geo/base_record.rb', line 100 def imported? status == STATUS_IMPORTED end |
#manual? ⇒ Boolean
Return true if the record was manually added to the database.
114 115 116 |
# File 'lib/us_geo/base_record.rb', line 114 def manual? status == STATUS_MANUAL end |
#removed? ⇒ Boolean
Return true if the record was removed from the data source distributed with the gem.
107 108 109 |
# File 'lib/us_geo/base_record.rb', line 107 def removed? status == STATUS_REMOVED end |