lib/geokit-rails/acts_as_mappable.rb
# Looks for mapping-specific tokens and makes appropriate translations so that the 
# original finder has its expected arguments.  Resets the the scope argument to 
# :first and ensures the limit is set to one.
Looks for mapping-specific tokens and makes appropriate translations so that the
original finder has its expected arguments.  Resets the the scope argument to
:first and ensures the limit is set to one.
Looks for mapping - specific tokens and makes appropriate translations so that the original finder has its expected arguments . Resets the the scope argument to : first and ensures the limit is set to one .
def apply_find_scope(args, options)
        case args.first
          when :nearest, :closest
            args[0] = :first
            options[:limit] = 1
            options[:order] = "#{distance_column_name} ASC"
          when :farthest
            args[0] = :first
            options[:limit] = 1
            options[:order] = "#{distance_column_name} DESC"
        end
      end
def apply_find_scope ( args , options ) case args . first when :nearest , :closest args [ 0 ] = :first options [ :limit ] = 1 options [ :order ] = "#{distance_column_name} ASC" when :farthest args [ 0 ] = :first options [ :limit ] = 1 options [ :order ] = "#{distance_column_name} DESC" end end
Looks for mapping-specific tokens and makes appropriate translations so that the
original finder has its expected arguments.
Looks for mapping - specific tokens and makes appropriate translations so that the original finder has its expected arguments .
args
<not_specific>
options
<not_specific>