Class: Geocoding

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/acts_as_geocodable/geocoding.rb

Class Method Summary collapse

Class Method Details

.find_geocodable(geocoded_class, geocoded_id) ⇒ Object



9
10
11
# File 'lib/acts_as_geocodable/geocoding.rb', line 9

def self.find_geocodable(geocoded_class, geocoded_id)
  geocoded_class.constantize.find(geocoded_id)
end

.geocoded_class(geocodable) ⇒ Object



5
6
7
# File 'lib/acts_as_geocodable/geocoding.rb', line 5

def self.geocoded_class(geocodable)
  ActiveRecord::Base.send(:class_name_of_active_record_descendant, geocodable.class).to_s
end