aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request_event.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-10-09 14:06:45 +0100
committerFrancis Irving <francis@mysociety.org>2010-10-09 14:06:45 +0100
commit269025f66214fae18dda1d0e31f423dbe3ab6583 (patch)
tree604445ac2403a66df6b27fa7b267157a605d3536 /app/models/info_request_event.rb
parent9f7f967ebe1e11a0f712e035fbbc3a77a005e0f8 (diff)
Index tags on info requests.
Diffstat (limited to 'app/models/info_request_event.rb')
-rw-r--r--app/models/info_request_event.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index 4a659dc65..8ad2d5964 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -109,7 +109,8 @@ class InfoRequestEvent < ActiveRecord::Base
[ :commented_by, 'C', "commented_by" ],
[ :request, 'R', "request" ],
[ :variety, 'V', "variety" ],
- [ :filetype, 'T', "filetype" ]
+ [ :filetype, 'T', "filetype" ],
+ [ :tags, 'U', "tag" ]
],
:if => :indexed_by_search?,
:eager_load => [ :incoming_message, :outgoing_message, :comment, { :info_request => [ :user, :public_body, :censor_rules ] } ]
@@ -188,6 +189,10 @@ class InfoRequestEvent < ActiveRecord::Base
end
return ''
end
+ def tags
+ # this returns an array of strings, each gets indexed as separate term by acts_as_xapian
+ return self.info_request.tag_array_for_search
+ end
def indexed_by_search?
if ['sent', 'followup_sent', 'response', 'comment'].include?(self.event_type)
if !self.info_request.indexed_by_search?