Class: USGeo::BaseRecord

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/us_geo/base_record.rb

Overview

Base class that all models inherit from.

Constant Summary collapse

STATUS_IMPORTED =
1
STATUS_REMOVED =
-1
STATUS_MANUAL =
0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#statusInteger

Returns:

  • (Integer)


# File 'lib/us_geo/base_record.rb', line 83

#updated_atTime

Returns:

  • (Time)


# File 'lib/us_geo/base_record.rb', line 86

Class Method Details

.load!(location = nil, gzipped: true) ⇒ Object

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/us_geo/base_record.rb', line 24

def load!(location = nil, gzipped: true)
  raise NotImplementedError
end

Instance Method Details

#imported?Boolean

Return true if the record was imported from the data source distributed with the gem.

Returns:

  • (Boolean)


92
93
94
# File 'lib/us_geo/base_record.rb', line 92

def imported?
  status == STATUS_IMPORTED
end

#manual?Boolean

Return true if the record was manually added to the database.

Returns:

  • (Boolean)


106
107
108
# File 'lib/us_geo/base_record.rb', line 106

def manual?
  status == STATUS_MANUAL
end

#removed?Boolean

Return true if the record was removed from the data source distributed with the gem.

Returns:

  • (Boolean)


99
100
101
# File 'lib/us_geo/base_record.rb', line 99

def removed?
  status == STATUS_REMOVED
end