Sha256: fad6d4a9b6000fea7151bf74dc163e7ddb2c9bd24a4d51b54642cdab61edfc06
Contents?: true
Size: 1.13 KB
Versions: 10
Compression:
Stored size: 1.13 KB
Contents
require 'geocoder/models/base' module Geocoder module Model module ActiveRecord include Base ## # Set attribute names and include the Geocoder module. # def geocoded_by(address_attr, options = {}, &block) geocoder_init( :geocode => true, :user_address => address_attr, :latitude => options[:latitude] || :latitude, :longitude => options[:longitude] || :longitude, :geocode_block => block ) end ## # Set attribute names and include the Geocoder module. # def reverse_geocoded_by(latitude_attr, longitude_attr, options = {}, &block) geocoder_init( :reverse_geocode => true, :fetched_address => options[:address] || :address, :latitude => latitude_attr, :longitude => longitude_attr, :reverse_block => block ) end private # -------------------------------------------------------------- def geocoder_file_name; "active_record"; end def geocoder_module_name; "ActiveRecord"; end end end end
Version data entries
10 entries across 10 versions & 1 rubygems