lib/geokit-rails/acts_as_mappable.rb
# Looks for the distance column and replaces it with the distance sql. If an origin was not 
# passed in and the distance column exists, we leave it to be flagged as bad SQL by the database.
# Conditions are either a string or an array.  In the case of an array, the first entry contains
# the condition.
Looks for the distance column and replaces it with the distance sql. If an origin was not
passed in and the distance column exists, we leave it to be flagged as bad SQL by the database.
Conditions are either a string or an array.  In the case of an array, the first entry contains
the condition.
Looks for the distance column and replaces it with the distance sql . If an origin was not passed in and the distance column exists we leave it to be flagged as bad SQL by the database . Conditions are either a string or an array . In the case of an array the first entry contains the condition .
def substitute_distance_in_conditions(options, origin, units=default_units, formula=default_formula)
        condition = options[:conditions].is_a?(String) ? options[:conditions] : options[:conditions].first
        pattern = Regexp.new("\\b#{distance_column_name}\\b")
        condition.gsub!(pattern, distance_sql(origin, units, formula))
      end
def substitute_distance_in_conditions ( options , origin , units = default_units , formula = default_formula ) condition = options [ :conditions ] . is_a? ( String ) ? options [ :conditions ] : options [ :conditions ] . first pattern = Regexp . new ( "\\b#{distance_column_name}\\b" ) condition . gsub! ( pattern , distance_sql ( origin , units , formula ) ) end
Looks for the distance column and replaces it with the distance sql.
Looks for the distance column and replaces it with the distance sql .
options
<not_specific>
origin
<not_specific>
units
<not_specific>
default_units
<not_specific>
formula
<not_specific>
default_formula
<not_specific>