Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Substitute distance in where values only if there is an origin

  • Loading branch information...
commit 48b3ed3b0e9310782c23341147ac05dde0ed414c 1 parent 792ae31
@jlecour jlecour authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/geokit-rails3/acts_as_mappable.rb
View
4 lib/geokit-rails3/acts_as_mappable.rb
@@ -130,7 +130,9 @@ def geo_scope(options = {})
distance_conditions = distance_conditions(options)
arel = arel.where(distance_conditions) if distance_conditions
- arel = substitute_distance_in_where_values(arel, origin, units, formula)
+ if origin
+ arel = substitute_distance_in_where_values(arel, origin, units, formula)
+ end
end
arel
Please sign in to comment.
Something went wrong with that request. Please try again.