diff --git a/app/models/post.rb b/app/models/post.rb index dd62fc6..489a990 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -41,7 +41,7 @@ class Post < ActiveRecord::Base - radians('#{lon}') ) + sin( radians('#{lat}') ) * sin( radians( p.lat ) ) ) ) - < #{radius_metres} + <= #{radius_metres} ORDER BY distance