Skip to content
Snippets Groups Projects
Commit f04fed05 authored by Alex Reisner's avatar Alex Reisner
Browse files

Merge pull request #733 from dgilperez/master

Add table_name to AR geocoded and not_geocoded scopes
parents 381c289f d1ecc2e1
No related branches found
No related tags found
No related merge requests found
...@@ -18,14 +18,14 @@ module Geocoder::Store ...@@ -18,14 +18,14 @@ module Geocoder::Store
# scope: geocoded objects # scope: geocoded objects
scope :geocoded, lambda { scope :geocoded, lambda {
where("#{geocoder_options[:latitude]} IS NOT NULL " + where("#{table_name}.#{geocoder_options[:latitude]} IS NOT NULL " +
"AND #{geocoder_options[:longitude]} IS NOT NULL") "AND #{table_name}.#{geocoder_options[:longitude]} IS NOT NULL")
} }
# scope: not-geocoded objects # scope: not-geocoded objects
scope :not_geocoded, lambda { scope :not_geocoded, lambda {
where("#{geocoder_options[:latitude]} IS NULL " + where("#{table_name}.#{geocoder_options[:latitude]} IS NULL " +
"OR #{geocoder_options[:longitude]} IS NULL") "OR #{table_name}.#{geocoder_options[:longitude]} IS NULL")
} }
## ##
...@@ -107,7 +107,7 @@ module Geocoder::Store ...@@ -107,7 +107,7 @@ module Geocoder::Store
# * +:exclude+ - an object to exclude (used by the +nearbys+ method) # * +:exclude+ - an object to exclude (used by the +nearbys+ method)
# * +:distance_column+ - used to set the column name of the calculated distance. # * +:distance_column+ - used to set the column name of the calculated distance.
# * +:bearing_column+ - used to set the column name of the calculated bearing. # * +:bearing_column+ - used to set the column name of the calculated bearing.
# * +:min_radius+ - the value to use as the minimum radius. # * +:min_radius+ - the value to use as the minimum radius.
# ignored if database is sqlite. # ignored if database is sqlite.
# default is 0.0 # default is 0.0
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment