aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-04-30 00:46:00 +0000
committerfrancis <francis>2008-04-30 00:46:00 +0000
commit4fc6f78113ad66b8b0381aa8a322b2c2db346864 (patch)
tree452313052f4c4fc75f81d25bfea55e5017e472ef /app/models/info_request.rb
parentb148ac567de92a09fe11cc3550c19725e321896d (diff)
Do collapsing for search, but not for email or RSS
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index e75127667..43bc69259 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -21,7 +21,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.99 2008-04-30 00:37:50 francis Exp $
+# $Id: info_request.rb,v 1.100 2008-04-30 00:46:01 francis Exp $
require 'digest/sha1'
require 'vendor/plugins/acts_as_xapian/lib/acts_as_xapian'
@@ -67,7 +67,7 @@ class InfoRequest < ActiveRecord::Base
# Central function to do all searches
# (Not really the right place to put it, but everything can get it here, and it
# does *mainly* find info requests, via their events, so hey)
- def InfoRequest.full_search(query, order, ascending, per_page, page, html_highlight)
+ def InfoRequest.full_search(query, order, ascending, collapse, per_page, page)
# XXX handle order better
# XXX html_highlight
offset = (page - 1) * per_page
@@ -75,8 +75,8 @@ class InfoRequest < ActiveRecord::Base
[InfoRequestEvent, PublicBody, User], query,
:offset => offset, :limit => per_page,
:sort_by_prefix => order,
- :sort_by_ascending => ascending
-# :collapse_by_prefix => "request_collapse" # XXX fix this so off for email/RSS, on for web
+ :sort_by_ascending => ascending,
+ :collapse_by_prefix => collapse
)
end
@@ -87,7 +87,7 @@ class InfoRequest < ActiveRecord::Base
t = Time.now.usec - t
secs = t / 1000000.0
STDOUT.write secs.to_s + " query " + i.to_s + "\n"
- results = InfoRequest.full_search(query, "created_at", false, 25, 1, false).results
+ results = InfoRequest.full_search(query, "created_at", false, nil, 25, 1).results
end
end