Module: GeoQuery::GeoQueryable::ClassMethods

Defined in:
lib/geo_query/geo_queryable.rb

Instance Method Summary collapse

Instance Method Details

#geo_queryable(options = {}) ⇒ Object

Init method



63
64
65
66
67
68
69
70
71
# File 'lib/geo_query/geo_queryable.rb', line 63

def geo_queryable(options = {})
  self.base_class.point_column = options[:coordinates] || :coordinates

  # Validations
  validate :save_coordinates

  # Callbacks
  before_save :set_location_updated_at, if: :location_changed?
end