This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

constrain the locations a bit; geocoding quality is actually really good

  • Loading branch information...
Troy Davis
Troy Davis committed Aug 24, 2010
1 parent 773c804 commit 818dd8d1164da23fdadab80254b8c42f8b360b20
Showing with 5 additions and 5 deletions.
  1. +4 −4 app/controllers/emergencies_controller.rb
  2. +1 −1 test/functional/emergencies_controller_test.rb
@@ -12,22 +12,22 @@ def index
end
@police_reports = PoliceReport.newest.find(:all, :origin => @origin,
- :within => params[:d] || 1.5, :limit => 4,
+ :within => params[:d] || 0.6, :limit => 4,
:order => 'reporteddate DESC')
if @police_reports.length < 4
@police_reports = @police_reports + PoliceReport.recent.find(:all, :origin => @origin,
- :within => params[:d] || 3, :limit => (4-@police_reports.length),
+ :within => params[:d] || 2, :limit => (4-@police_reports.length),
:order => 'distance ASC, reporteddate DESC')
end
@fire_dispatches = FireDispatch.newest.find(:all, :origin => @origin,
- :within => params[:d] || 1.5, :limit => 4,
+ :within => params[:d] || 0.6, :limit => 4,
:order => 'occurred DESC')
if @fire_dispatches.length < 4
@fire_dispatches = @fire_dispatches + FireDispatch.recent.find(:all, :origin => @origin,
- :within => params[:d] || 3, :limit => (4-@fire_dispatches.length),
+ :within => params[:d] || 2, :limit => (4-@fire_dispatches.length),
:order => 'distance ASC, occurred DESC')
end
@@ -25,7 +25,7 @@ class EmergenciesControllerTest < ActionController::TestCase
should_assign_to :search_query
should 'find the right number of emergencies' do
- assert_equal 2, assigns(:police_reports).length
+ assert_equal 1, assigns(:police_reports).length
end
end

0 comments on commit 818dd8d

Please sign in to comment.