aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request_event.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-08-22 14:11:02 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-08-22 14:19:05 +0100
commit5c3881bfacdb34a605ddfbadf1531d0e341d7beb (patch)
tree088e752d1a6d2fb38d1409dbfb1cb332af92594c /app/models/info_request_event.rb
parent15a174375e638b91c138d771d4851613110f9cdc (diff)
parenta29b3aaf0ae77af49d38813b62dddcb6889c1ebe (diff)
merge from master and make tests pass
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 02b9a34ac..d79647c98 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -121,7 +121,12 @@ class InfoRequestEvent < ActiveRecord::Base
self.info_request.user.url_name
end
def requested_from
- self.info_request.public_body.url_name
+ # acts_as_xapian will detect translated fields via Globalize and add all the
+ # available locales to the index. But 'requested_from' is not translated directly,
+ # although it relies on a translated field in PublicBody. Hence, we need to
+ # manually add all the localized values to the index (Xapian can handle a list
+ # of values in a term, btw)
+ self.info_request.public_body.translations.map {|t| t.url_name}
end
def commented_by
if self.event_type == 'comment'