diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/request_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/track_controller.rb | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 8a128ea30..7bf2deba0 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: request_controller.rb,v 1.80 2008-05-12 01:37:50 francis Exp $ +# $Id: request_controller.rb,v 1.81 2008-05-12 01:53:41 francis Exp $ class RequestController < ApplicationController @@ -42,11 +42,7 @@ class RequestController < ApplicationController # Already tracking? @track_thing = TrackThing.create_track_for_request(@info_request) - if @user - @existing_track = TrackThing.find_by_existing_track(@user.id, @track_thing.track_query) - else - @existing_track = nil - end + @existing_track = TrackThing.find_by_existing_track(@user, @track_thing.track_query) end def list @@ -56,6 +52,9 @@ class RequestController < ApplicationController @title = "Recently sent Freedom of Information requests" query = "variety:sent"; sortby = "newest" + # Already tracking? + @track_thing = TrackThing.create_track_for_all_new_requests() + @existing_track = TrackThing.find_by_existing_track(@user, @track_thing.track_query) elsif @view == 'successful' @title = "Recent successful responses" query = 'variety:response (status:successful OR status:partially_successful)' diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index f1f9c1fd3..416b98e59 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -5,7 +5,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_controller.rb,v 1.10 2008-05-12 01:37:50 francis Exp $ +# $Id: track_controller.rb,v 1.11 2008-05-12 01:53:41 francis Exp $ class TrackController < ApplicationController @@ -41,7 +41,7 @@ class TrackController < ApplicationController # Generic request tracker - set @track_thing before calling def track_set if @user - @existing_track = TrackThing.find_by_existing_track(@user.id, @track_thing.track_query) + @existing_track = TrackThing.find_by_existing_track(@user, @track_thing.track_query) if @existing_track return "already" end |