Skip to content

Commit

Permalink
Shows only regions of the same country when showing regions near to a…
Browse files Browse the repository at this point in the history
…nother one
  • Loading branch information
Ferdev committed Apr 19, 2013
1 parent 662dc26 commit 1421ea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def near(site, limit = 5)
) as count
from regions as re
where id!=#{self.id} and
level=#{site.level_for_region}
level=#{site.level_for_region} and
country_id = #{self.country_id}
order by dist
) as subq
where count>0
Expand Down

0 comments on commit 1421ea6

Please sign in to comment.