diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application.rb | 4 | ||||
-rw-r--r-- | app/models/info_request_event.rb | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 736656dec..2f27f2872 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.38 2008-04-14 14:46:47 francis Exp $ +# $Id: application.rb,v 1.39 2008-04-17 23:19:55 francis Exp $ class ApplicationController < ActionController::Base @@ -134,7 +134,7 @@ class ApplicationController < ActionController::Base elsif sortby == 'newest' return 'created_at desc' elsif sortby == 'described' - return 'last_described_at desc' # use this for RSS + return 'rss_at desc' # use this for RSS else raise "Unknown sort order " + @sortby end diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index f7897ed9d..27aab94a8 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -18,7 +18,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.36 2008-04-15 23:53:10 francis Exp $ +# $Id: info_request_event.rb,v 1.37 2008-04-17 23:19:55 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -59,7 +59,7 @@ class InfoRequestEvent < ActiveRecord::Base { :requested_from => :string }, { :request => :string }, { :created_at => :date }, - { :last_described_at => :date }, + { :rss_at => :date }, { :variety => :string } ], :if => "$do_solr_index" def status # for name in Solr queries @@ -74,6 +74,13 @@ class InfoRequestEvent < ActiveRecord::Base def request self.info_request.url_title end + def rss_at + # For responses, people might have RSS feeds on searches for type of + # response (e.g. successful) in which case we want to date sort by + # when the responses was described as being of the type. For other + # types, just use the create at date. + self.last_described_at || self.created_at + end def solr_text_main text = '' if self.event_type == 'sent' |