Permalink
Browse files

Substitute distance in where values only if there is an origin

  • Loading branch information...
1 parent 792ae31 commit 48b3ed3b0e9310782c23341147ac05dde0ed414c @jlecour jlecour committed Oct 16, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 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

0 comments on commit 48b3ed3

Please sign in to comment.