aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony <tony>2009-03-04 11:26:35 +0000
committertony <tony>2009-03-04 11:26:35 +0000
commit407b762bf366854fbe0dcca50a3e48c5af0eab1e (patch)
treec9e6cc6adedf79eb46187895eabc657cf80b2467
parent010e1f75aa4e9697b09ebc7947e0adc4119ab298 (diff)
Add publication scheme for public bodies. (New database column and admin
interface only; public display can come later.)
-rw-r--r--app/models/censor_rule.rb4
-rw-r--r--app/models/comment.rb4
-rw-r--r--app/models/contact_validator.rb4
-rw-r--r--app/models/exim_log.rb4
-rw-r--r--app/models/exim_log_done.rb4
-rw-r--r--app/models/incoming_message.rb4
-rw-r--r--app/models/info_request.rb4
-rw-r--r--app/models/info_request_event.rb4
-rw-r--r--app/models/outgoing_message.rb4
-rw-r--r--app/models/post_redirect.rb4
-rw-r--r--app/models/public_body.rb31
-rw-r--r--app/models/public_body_tag.rb4
-rw-r--r--app/models/raw_email.rb4
-rw-r--r--app/models/track_thing.rb4
-rw-r--r--app/models/track_things_sent_email.rb4
-rw-r--r--app/models/user.rb4
-rw-r--r--app/models/user_info_request_sent_alert.rb4
-rw-r--r--app/views/admin_public_body/_form.rhtml3
-rw-r--r--db/migrate/072_add_publication_scheme.rb12
-rw-r--r--db/schema.rb28
20 files changed, 78 insertions, 60 deletions
diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb
index 65b9239f7..4a21821de 100644
--- a/app/models/censor_rule.rb
+++ b/app/models/censor_rule.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: censor_rules
#
@@ -21,7 +21,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: censor_rule.rb,v 1.6 2009-02-09 09:51:52 francis Exp $
+# $Id: censor_rule.rb,v 1.7 2009-03-04 11:26:35 tony Exp $
class CensorRule < ActiveRecord::Base
belongs_to :info_request
diff --git a/app/models/comment.rb b/app/models/comment.rb
index 125b875ac..7a7e2ad60 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: comments
#
@@ -19,7 +19,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: comment.rb,v 1.11 2009-02-09 09:51:52 francis Exp $
+# $Id: comment.rb,v 1.12 2009-03-04 11:26:35 tony Exp $
class Comment < ActiveRecord::Base
strip_attributes!
diff --git a/app/models/contact_validator.rb b/app/models/contact_validator.rb
index e54766358..92251c246 100644
--- a/app/models/contact_validator.rb
+++ b/app/models/contact_validator.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: contact_validators
#
@@ -15,7 +15,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: contact_validator.rb,v 1.26 2009-02-09 09:51:52 francis Exp $
+# $Id: contact_validator.rb,v 1.27 2009-03-04 11:26:35 tony Exp $
class ContactValidator < ActiveRecord::BaseWithoutTable
strip_attributes!
diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb
index d02a327e7..b93eaa710 100644
--- a/app/models/exim_log.rb
+++ b/app/models/exim_log.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: exim_logs
#
@@ -18,7 +18,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: exim_log.rb,v 1.5 2009-02-27 18:52:57 francis Exp $
+# $Id: exim_log.rb,v 1.6 2009-03-04 11:26:35 tony Exp $
class EximLog < ActiveRecord::Base
belongs_to :info_request
diff --git a/app/models/exim_log_done.rb b/app/models/exim_log_done.rb
index 6dced74f0..40e103978 100644
--- a/app/models/exim_log_done.rb
+++ b/app/models/exim_log_done.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: exim_log_dones
#
@@ -16,7 +16,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: exim_log_done.rb,v 1.2 2009-02-09 09:51:53 francis Exp $
+# $Id: exim_log_done.rb,v 1.3 2009-03-04 11:26:35 tony Exp $
class EximLogDone < ActiveRecord::Base
has_many :exim_logs
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 06d76648d..3b039e3b0 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: incoming_messages
#
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.189 2009-02-28 01:28:22 francis Exp $
+# $Id: incoming_message.rb,v 1.190 2009-03-04 11:26:35 tony Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index f7579c6d8..c6fc46dfe 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: info_requests
#
@@ -23,7 +23,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.166 2009-02-27 22:32:13 francis Exp $
+# $Id: info_request.rb,v 1.167 2009-03-04 11:26:35 tony Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index 291073273..938b5313a 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: info_request_events
#
@@ -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_event.rb,v 1.73 2009-02-27 22:32:13 francis Exp $
+# $Id: info_request_event.rb,v 1.74 2009-03-04 11:26:35 tony Exp $
class InfoRequestEvent < ActiveRecord::Base
belongs_to :info_request
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index 323c11cc0..3c114cd25 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: outgoing_messages
#
@@ -22,7 +22,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: outgoing_message.rb,v 1.78 2009-02-09 09:51:53 francis Exp $
+# $Id: outgoing_message.rb,v 1.79 2009-03-04 11:26:35 tony Exp $
class OutgoingMessage < ActiveRecord::Base
strip_attributes!
diff --git a/app/models/post_redirect.rb b/app/models/post_redirect.rb
index 4cdee8415..1bb4be83a 100644
--- a/app/models/post_redirect.rb
+++ b/app/models/post_redirect.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: post_redirects
#
@@ -26,7 +26,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: post_redirect.rb,v 1.44 2009-02-09 09:51:53 francis Exp $
+# $Id: post_redirect.rb,v 1.45 2009-03-04 11:26:35 tony Exp $
require 'openssl' # for random bytes function
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 9abc4440d..76175a945 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -1,21 +1,22 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: public_bodies
#
-# id :integer not null, primary key
-# name :text not null
-# short_name :text not null
-# request_email :text not null
-# version :integer not null
-# last_edit_editor :string(255) not null
-# last_edit_comment :text not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# url_name :text not null
-# home_page :text default(""), not null
-# notes :text default(""), not null
-# first_letter :string(255) not null
+# id :integer not null, primary key
+# name :text not null
+# short_name :text not null
+# request_email :text not null
+# version :integer not null
+# last_edit_editor :string(255) not null
+# last_edit_comment :text not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# url_name :text not null
+# home_page :text default(""), not null
+# notes :text default(""), not null
+# first_letter :string(255) not null
+# publication_scheme :text default(""), not null
#
# models/public_body.rb:
@@ -24,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.130 2009-02-12 17:24:48 francis Exp $
+# $Id: public_body.rb,v 1.131 2009-03-04 11:26:35 tony Exp $
require 'csv'
require 'set'
diff --git a/app/models/public_body_tag.rb b/app/models/public_body_tag.rb
index 62410da60..b25396087 100644
--- a/app/models/public_body_tag.rb
+++ b/app/models/public_body_tag.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: public_body_tags
#
@@ -15,7 +15,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: public_body_tag.rb,v 1.23 2009-02-09 09:51:53 francis Exp $
+# $Id: public_body_tag.rb,v 1.24 2009-03-04 11:26:35 tony Exp $
class PublicBodyTag < ActiveRecord::Base
strip_attributes!
diff --git a/app/models/raw_email.rb b/app/models/raw_email.rb
index 867fd5f9e..28085a6ef 100644
--- a/app/models/raw_email.rb
+++ b/app/models/raw_email.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: raw_emails
#
@@ -13,7 +13,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: raw_email.rb,v 1.6 2009-02-09 09:51:53 francis Exp $
+# $Id: raw_email.rb,v 1.7 2009-03-04 11:26:35 tony Exp $
class RawEmail < ActiveRecord::Base
# deliberately don't strip_attributes, so keeps raw email properly
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index 8d605bd6a..b0b4c8d47 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: track_things
#
@@ -21,7 +21,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: track_thing.rb,v 1.47 2009-02-09 09:51:53 francis Exp $
+# $Id: track_thing.rb,v 1.48 2009-03-04 11:26:35 tony Exp $
class TrackThing < ActiveRecord::Base
belongs_to :tracking_user, :class_name => 'User'
diff --git a/app/models/track_things_sent_email.rb b/app/models/track_things_sent_email.rb
index af5c51b48..d8be03307 100644
--- a/app/models/track_things_sent_email.rb
+++ b/app/models/track_things_sent_email.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: track_things_sent_emails
#
@@ -18,7 +18,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: track_things_sent_email.rb,v 1.16 2009-02-09 09:51:53 francis Exp $
+# $Id: track_things_sent_email.rb,v 1.17 2009-03-04 11:26:35 tony Exp $
class TrackThingsSentEmail < ActiveRecord::Base
belongs_to :info_request_event
diff --git a/app/models/user.rb b/app/models/user.rb
index ed7104450..d77509a48 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: users
#
@@ -22,7 +22,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user.rb,v 1.80 2009-02-09 09:51:53 francis Exp $
+# $Id: user.rb,v 1.81 2009-03-04 11:26:35 tony Exp $
require 'digest/sha1'
diff --git a/app/models/user_info_request_sent_alert.rb b/app/models/user_info_request_sent_alert.rb
index b5a6d09db..b472b7fa2 100644
--- a/app/models/user_info_request_sent_alert.rb
+++ b/app/models/user_info_request_sent_alert.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 71
+# Schema version: 72
#
# Table name: user_info_request_sent_alerts
#
@@ -17,7 +17,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user_info_request_sent_alert.rb,v 1.27 2009-02-09 09:51:53 francis Exp $
+# $Id: user_info_request_sent_alert.rb,v 1.28 2009-03-04 11:26:35 tony Exp $
class UserInfoRequestSentAlert < ActiveRecord::Base
belongs_to :user
diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml
index f8e49eb9e..42aaf92db 100644
--- a/app/views/admin_public_body/_form.rhtml
+++ b/app/views/admin_public_body/_form.rhtml
@@ -33,6 +33,9 @@
<p><label for="public_body_home_page">Home page <small>(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</small></label><br/>
<%= text_field 'public_body', 'home_page', :size => 60 %></p>
+<p><label for="public_body_publication_scheme">Publication scheme URL</label><br/>
+<%= text_field 'public_body', 'publication_scheme', :size => 60 %></p>
+
<p><label for="public_body_notes">Public notes</label> <small>(for users to consider when making FOI requests to the authority)</small><br/>
<%= text_area 'public_body', 'notes', :rows => 3, :cols => 60 %></p>
diff --git a/db/migrate/072_add_publication_scheme.rb b/db/migrate/072_add_publication_scheme.rb
new file mode 100644
index 000000000..5040d1709
--- /dev/null
+++ b/db/migrate/072_add_publication_scheme.rb
@@ -0,0 +1,12 @@
+class AddPublicationScheme < ActiveRecord::Migration
+ def self.up
+ add_column :public_bodies, :publication_scheme, :text, :null => false, :default => ""
+ add_column :public_body_versions, :publication_scheme, :text, :null => false, :default => ""
+ end
+
+ def self.down
+ remove_column :public_bodies, :publication_scheme
+ remove_column :public_body_versions, :publication_scheme
+ end
+end
+
diff --git a/db/schema.rb b/db/schema.rb
index f9d59bc88..363e36a76 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 71) do
+ActiveRecord::Schema.define(:version => 72) do
create_table "acts_as_xapian_jobs", :force => true do |t|
t.string "model", :null => false
@@ -133,18 +133,19 @@ ActiveRecord::Schema.define(:version => 71) do
add_index "post_redirects", ["updated_at"], :name => "index_post_redirects_on_updated_at"
create_table "public_bodies", :force => true do |t|
- t.text "name", :null => false
- t.text "short_name", :null => false
- t.text "request_email", :null => false
- t.integer "version", :null => false
- t.string "last_edit_editor", :null => false
- t.text "last_edit_comment", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.text "url_name", :null => false
- t.text "home_page", :default => "", :null => false
- t.text "notes", :default => "", :null => false
- t.string "first_letter", :null => false
+ t.text "name", :null => false
+ t.text "short_name", :null => false
+ t.text "request_email", :null => false
+ t.integer "version", :null => false
+ t.string "last_edit_editor", :null => false
+ t.text "last_edit_comment", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.text "url_name", :null => false
+ t.text "home_page", :default => "", :null => false
+ t.text "notes", :default => "", :null => false
+ t.string "first_letter", :null => false
+ t.text "publication_scheme", :default => "", :null => false
end
add_index "public_bodies", ["first_letter"], :name => "index_public_bodies_on_first_letter"
@@ -170,6 +171,7 @@ ActiveRecord::Schema.define(:version => 71) do
t.text "url_name"
t.text "home_page"
t.text "notes"
+ t.text "publication_scheme", :default => "", :null => false
end
create_table "raw_emails", :force => true do |t|