From 060d9fe70a1de0ba9aa592d25d6e7352114aa431 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 25 Mar 2013 16:17:03 +1100 Subject: Inline method InfoRequest.full_search --- app/models/info_request.rb | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 156399b99..4db4dadb0 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -189,21 +189,6 @@ class InfoRequest < ActiveRecord::Base self.comments.find(:all, :conditions => 'visible') end - # 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(models, query, order, ascending, collapse, per_page, page) - offset = (page - 1) * per_page - - return ::ActsAsXapian::Search.new( - models, query, - :offset => offset, :limit => per_page, - :sort_by_prefix => order, - :sort_by_ascending => ascending, - :collapse_by_prefix => collapse - ) - end - # If the URL name has changed, then all request: queries will break unless # we update index for every event. Also reindex if prominence changes. after_update :reindex_some_request_events -- cgit v1.2.3 From b340c98efcdf41a3c189631e4af5042d507ecf4d Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Mon, 25 Mar 2013 16:21:46 +1100 Subject: Remove unused method --- app/models/info_request.rb | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 4db4dadb0..499fb20a9 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -217,17 +217,6 @@ class InfoRequest < ActiveRecord::Base end end - # For debugging - def InfoRequest.profile_search(query) - t = Time.now.usec - for i in (1..10) - t = Time.now.usec - t - secs = t / 1000000.0 - STDOUT.write secs.to_s + " query " + i.to_s + "\n" - results = InfoRequest.full_search([InfoRequestEvent], query, "created_at", true, nil, 25, 1).results - end - end - public # When name is changed, also change the url name def title=(title) -- cgit v1.2.3