Skip to content
Snippets Groups Projects
Commit bf911edd authored by Mike Park's avatar Mike Park
Browse files

delay evaluation of geocoder_options

the scope is defined before geocoder_options have 
been initialized.
parent 53fdf15e
No related branches found
No related tags found
No related merge requests found
...@@ -17,14 +17,14 @@ module Geocoder::Orm ...@@ -17,14 +17,14 @@ module Geocoder::Orm
base.class_eval do base.class_eval do
# scope: geocoded objects # scope: geocoded objects
scope :geocoded, scope :geocoded, lambda {
:conditions => "#{geocoder_options[:latitude]} IS NOT NULL " + {:conditions => "#{geocoder_options[:latitude]} IS NOT NULL " +
"AND #{geocoder_options[:longitude]} IS NOT NULL" "AND #{geocoder_options[:longitude]} IS NOT NULL"}}
# scope: not-geocoded objects # scope: not-geocoded objects
scope :not_geocoded, scope :not_geocoded, lambda {
:conditions => "#{geocoder_options[:latitude]} IS NULL " + {:conditions => "#{geocoder_options[:latitude]} IS NULL " +
"OR #{geocoder_options[:longitude]} IS NULL" "OR #{geocoder_options[:longitude]} IS NULL"}}
## ##
# Find all objects within a radius (in miles) of the given location # Find all objects within a radius (in miles) of the given location
......
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