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
base.class_eval do
# scope: geocoded objects
scope :geocoded,
:conditions => "#{geocoder_options[:latitude]} IS NOT NULL " +
"AND #{geocoder_options[:longitude]} IS NOT NULL"
scope :geocoded, lambda {
{:conditions => "#{geocoder_options[:latitude]} IS NOT NULL " +
"AND #{geocoder_options[:longitude]} IS NOT NULL"}}
# scope: not-geocoded objects
scope :not_geocoded,
:conditions => "#{geocoder_options[:latitude]} IS NULL " +
"OR #{geocoder_options[:longitude]} IS NULL"
scope :not_geocoded, lambda {
{:conditions => "#{geocoder_options[:latitude]} IS NULL " +
"OR #{geocoder_options[:longitude]} IS NULL"}}
##
# 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