aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/public_body.rb4
-rw-r--r--app/views/body/_body_listing_single.rhtml1
-rw-r--r--spec/fixtures/public_bodies.yml2
-rw-r--r--spec/models/public_body_spec.rb22
-rw-r--r--todo.txt6
5 files changed, 32 insertions, 3 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 0524b0395..5fff4a77f 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -25,7 +25,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: public_body.rb,v 1.134 2009-03-18 01:55:23 francis Exp $
+# $Id: public_body.rb,v 1.135 2009-03-18 05:04:47 francis Exp $
require 'csv'
require 'set'
@@ -177,7 +177,7 @@ class PublicBody < ActiveRecord::Base
end
end
- acts_as_xapian :texts => [ :name, :short_name ],
+ acts_as_xapian :texts => [ :name, :short_name, :notes ],
:values => [
[ :created_at_numeric, 1, "created_at", :number ] # for sorting
],
diff --git a/app/views/body/_body_listing_single.rhtml b/app/views/body/_body_listing_single.rhtml
index 13d43641a..d8cd6efbe 100644
--- a/app/views/body/_body_listing_single.rhtml
+++ b/app/views/body/_body_listing_single.rhtml
@@ -9,6 +9,7 @@
<span class="desc">
<% if not public_body.short_name.empty? %>
Also called <%=highlight_words(public_body.short_name, @highlight_words) %>.
+ <%= highlight_and_excerpt(public_body.notes, @highlight_words, 150) %>
<br>
<% end %>
</span>
diff --git a/spec/fixtures/public_bodies.yml b/spec/fixtures/public_bodies.yml
index 3d6a4ccc6..191dd68bb 100644
--- a/spec/fixtures/public_bodies.yml
+++ b/spec/fixtures/public_bodies.yml
@@ -22,4 +22,4 @@ humpadink_public_body:
short_name: DfH
url_name: dfh
created_at: 2007-10-25 10:51:01.161639
-
+ notes: An albatross told me!!!
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index 8fb263f7d..50c34fdc0 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -29,4 +29,26 @@ describe PublicBody, " when saving" do
end
+describe PublicBody, " when indexing with Xapian" do
+ fixtures :public_bodies
+
+ before do
+ rebuild_xapian_index
+ end
+
+ it "should search index the main name field" do
+ xapian_object = InfoRequest.full_search([PublicBody], "humpadinking", 'created_at', true, nil, 100, 1)
+ xapian_object.results.size.should == 1
+ xapian_object.results[0][:model].should == public_bodies(:humpadink_public_body)
+ end
+
+ it "should search index the notes field" do
+ xapian_object = InfoRequest.full_search([PublicBody], "albatross", 'created_at', true, nil, 100, 1)
+ xapian_object.results.size.should == 1
+ xapian_object.results[0][:model].should == public_bodies(:humpadink_public_body)
+ end
+
+end
+
+
diff --git a/todo.txt b/todo.txt
index febc62881..2375062e5 100644
--- a/todo.txt
+++ b/todo.txt
@@ -62,6 +62,12 @@ Give authorities interface for editing their request email address.
Later
=====
+There is some kind of workflow bug, where people send a follow
+up THEN mark as clarification needed, and so it emails to remind them when it
+doesn't really need to.
+e.g. https://secure.mysociety.org/admin/foi/request/show/8773
+
+
Change it to store emails as files in the filesystem? For speed.
Should have simpler system for us to upload files sent to us via CD etc.
Currently I have to manually put them in the files directory on the vhost.