diff options
-rw-r--r-- | app/models/incoming_message.rb | 5 | ||||
-rw-r--r-- | app/models/public_body.rb | 9 | ||||
-rw-r--r-- | app/views/admin_public_body/_form.rhtml | 3 | ||||
-rw-r--r-- | db/migrate/043_remove_complaint_email.rb | 12 | ||||
-rw-r--r-- | db/schema.rb | 4 | ||||
-rw-r--r-- | spec/fixtures/public_bodies.yml | 2 | ||||
-rw-r--r-- | spec/fixtures/public_body_versions.yml | 1 | ||||
-rw-r--r-- | spec/models/public_body_spec.rb | 12 | ||||
-rw-r--r-- | todo.txt | 7 |
9 files changed, 23 insertions, 32 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index aef293677..c2633df94 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -18,7 +18,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.65 2008-03-16 22:48:42 francis Exp $ +# $Id: incoming_message.rb,v 1.66 2008-03-17 10:48:46 francis Exp $ # TODO @@ -139,9 +139,6 @@ class IncomingMessage < ActiveRecord::Base if not self.info_request.public_body.request_email.empty? text = text.gsub(self.info_request.public_body.request_email, "[" + self.info_request.public_body.short_or_long_name + " request email]") end - if not self.info_request.public_body.complaint_email.empty? - text = text.gsub(self.info_request.public_body.complaint_email, "[" + self.info_request.public_body.short_or_long_name + " complaint email]") - end text = text.gsub(self.info_request.incoming_email, "[FOI #" + self.info_request.id.to_s + " email]") text = text.gsub(self.info_request.envelope_email, "[FOI #" + self.info_request.id.to_s + " bounce email]") text = text.gsub(MySociety::Config.get("CONTACT_EMAIL", 'contact@localhost'), "[WhatDoTheyKnow contact email]") diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 768da2a79..9417aab83 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -22,7 +22,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.37 2008-03-17 10:36:43 francis Exp $ +# $Id: public_body.rb,v 1.38 2008-03-17 10:48:46 francis Exp $ require 'csv' require 'set' @@ -51,11 +51,6 @@ class PublicBody < ActiveRecord::Base errors.add(:request_email, "doesn't look like a valid email address") end end - if self.complaint_email != "" - unless MySociety::Validate.is_valid_email(self.complaint_email) - errors.add(:complaint_email, "doesn't look like a valid email address") - end - end end acts_as_versioned @@ -149,7 +144,7 @@ class PublicBody < ActiveRecord::Base end else # New public body - public_body = PublicBody.new(:name => name, :request_email => email, :complaint_email => "", :short_name => "", :last_edit_editor => "import_csv", :last_edit_comment => 'Created from spreadsheet') + public_body = PublicBody.new(:name => name, :request_email => email, :short_name => "", :last_edit_editor => "import_csv", :last_edit_comment => 'Created from spreadsheet') public_body.tag_string = tag public_body.save! diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml index 4f1ede2cc..d53ab8134 100644 --- a/app/views/admin_public_body/_form.rhtml +++ b/app/views/admin_public_body/_form.rhtml @@ -18,9 +18,6 @@ <p><label for="public_body_request_email">Request email (set to blank if an old address became bad and you can't find a new one)</label><br/> <%= text_field 'public_body', 'request_email', :size => 40 %></p> -<p><label for="public_body_complaint_email">Complaint email</label><br/> -<%= text_field 'public_body', 'complaint_email', :size => 40 %></p> - <p><label for="public_body_last_edit_comment">Comment for this edit</label> (put URL or other source of new info)<br/> <%= text_area 'public_body', 'last_edit_comment', :rows => 3, :cols => 60 %></p> <!--[eoform:public_body]--> diff --git a/db/migrate/043_remove_complaint_email.rb b/db/migrate/043_remove_complaint_email.rb new file mode 100644 index 000000000..cc03f6507 --- /dev/null +++ b/db/migrate/043_remove_complaint_email.rb @@ -0,0 +1,12 @@ +class RemoveComplaintEmail < ActiveRecord::Migration + def self.up + remove_column :public_body_versions, :complaint_email + remove_column :public_bodies, :complaint_email + end + + def self.down + add_column :public_bodies, :complaint_email, :text + add_column :public_body_versions, :complaint_email, :text + end +end + diff --git a/db/schema.rb b/db/schema.rb index 00c77b946..5bcb2470e 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 => 42) do +ActiveRecord::Schema.define(:version => 43) do create_table "incoming_messages", :force => true do |t| t.integer "info_request_id", :null => false @@ -75,7 +75,6 @@ ActiveRecord::Schema.define(:version => 42) do t.text "name", :null => false t.text "short_name", :null => false t.text "request_email", :null => false - t.text "complaint_email" t.integer "version", :null => false t.string "last_edit_editor", :null => false t.text "last_edit_comment", :null => false @@ -100,7 +99,6 @@ ActiveRecord::Schema.define(:version => 42) do t.text "name" t.text "short_name" t.text "request_email" - t.text "complaint_email" t.datetime "updated_at" t.string "last_edit_editor" t.string "last_edit_comment" diff --git a/spec/fixtures/public_bodies.yml b/spec/fixtures/public_bodies.yml index 5a0facec9..88c19484b 100644 --- a/spec/fixtures/public_bodies.yml +++ b/spec/fixtures/public_bodies.yml @@ -2,7 +2,6 @@ geraldine_public_body: name: The Geraldine Quango updated_at: 2007-10-24 10:51:01.161639 last_edit_comment: Mark named this stupid quango. - complaint_email: geraldine-complaints@localhost request_email: geraldine-requests@localhost id: "2" version: "1" @@ -14,7 +13,6 @@ humpadink_public_body: name: "Department for Humpadinking" updated_at: 2007-10-25 10:51:01.161639 last_edit_comment: Not sure what this new department does. - complaint_email: humpadink-complaints@localhost request_email: humpadink-requests@localhost id: "3" version: "2" diff --git a/spec/fixtures/public_body_versions.yml b/spec/fixtures/public_body_versions.yml index d8bc6ea35..57c7757d5 100644 --- a/spec/fixtures/public_body_versions.yml +++ b/spec/fixtures/public_body_versions.yml @@ -2,7 +2,6 @@ humpadink_public_body_old1: name: "Department for Humpadinking" last_edit_comment: "Silly old abbrv" updated_at: 2007-10-13 12:08:23.836085 - complaint_email: humpadink-complaints@localhost request_email: humpadink-requests@localhost public_body_id: "3" id: "5" diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb index bd403dcd1..8fb263f7d 100644 --- a/spec/models/public_body_spec.rb +++ b/spec/models/public_body_spec.rb @@ -13,17 +13,6 @@ describe PublicBody, " when saving" do @public_body.name = "Testing Public Body" @public_body.short_name = "TPB" @public_body.request_email = "requestBOOlocalhost" - @public_body.complaint_email = "complaint@localhost" - @public_body.last_edit_editor = "*test*" - @public_body.last_edit_comment = "This is a test" - lambda { @public_body.save! }.should raise_error(ActiveRecord::RecordInvalid) - end - - it "should not save with misformatted complaint email" do - @public_body.name = "Testing Public Body" - @public_body.short_name = "TPB" - @public_body.request_email = "request@localhost" - @public_body.complaint_email = "complaintBOOlocalhost" @public_body.last_edit_editor = "*test*" @public_body.last_edit_comment = "This is a test" lambda { @public_body.save! }.should raise_error(ActiveRecord::RecordInvalid) @@ -33,7 +22,6 @@ describe PublicBody, " when saving" do @public_body.name = "Testing Public Body" @public_body.short_name = "TPB" @public_body.request_email = "request@localhost" - @public_body.complaint_email = "complaint@localhost" @public_body.last_edit_editor = "*test*" @public_body.last_edit_comment = "This is a test" @public_body.save! @@ -1,3 +1,10 @@ + +Remove complaint_email +Add list of things to do + + + + Search: Gah - test to see if it queries solr when new message arrives |