lib/geokit-rails/acts_as_mappable.rb
# Augments the select with the distance SQL.
Augments the select with the distance SQL.
Augments the select with the distance SQL .
def add_distance_to_select(options, origin, units=default_units, formula=default_formula)
        if origin
          distance_selector = distance_sql(origin, units, formula) + " AS #{distance_column_name}"
          selector = options.has_key?(:select) && options[:select] ? options[:select] : "*"
          options[:select] = "#{selector}, #{distance_selector}"  
        end
      end
def add_distance_to_select ( options , origin , units = default_units , formula = default_formula ) if origin distance_selector = distance_sql ( origin , units , formula ) + " AS #{distance_column_name}" selector = options . has_key? ( :select ) && options [ :select ] ? options [ :select ] : "*" options [ :select ] = "#{selector}, #{distance_selector}" end end
Augments the select with the distance SQL.
Augments the select with the distance SQL .
options
<not_specific>
origin
<not_specific>
units
<not_specific>
default_units
<not_specific>
formula
<not_specific>
default_formula
<not_specific>