aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/contact_validator.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.rb4
-rw-r--r--app/models/public_body_tag.rb4
-rw-r--r--app/models/track_thing.rb7
-rw-r--r--app/models/track_things_sent_email.rb6
-rw-r--r--app/models/user.rb23
-rw-r--r--app/models/user_info_request_sent_alert.rb4
-rw-r--r--db/migrate/051_add_track_things_unique_indices.rb11
-rw-r--r--db/schema.rb6
-rw-r--r--todo.txt16
15 files changed, 71 insertions, 34 deletions
diff --git a/app/models/contact_validator.rb b/app/models/contact_validator.rb
index 3af6ee2e8..954da9283 100644
--- a/app/models/contact_validator.rb
+++ b/app/models/contact_validator.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# 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.10 2008-04-01 16:40:37 francis Exp $
+# $Id: contact_validator.rb,v 1.11 2008-04-04 01:44:41 francis Exp $
class ContactValidator < ActiveRecord::BaseWithoutTable
column :name, :string
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 41ffa029c..6d37ab01d 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: incoming_messages
#
@@ -17,7 +17,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.72 2008-04-01 16:40:37 francis Exp $
+# $Id: incoming_message.rb,v 1.73 2008-04-04 01:44:41 francis Exp $
# TODO
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index cae7bc24f..2ec8ead1f 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: info_requests
#
@@ -22,7 +22,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.80 2008-04-03 17:23:39 francis Exp $
+# $Id: info_request.rb,v 1.81 2008-04-04 01:44:41 francis Exp $
require 'digest/sha1'
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index e07d645dd..7682aff11 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: info_request_events
#
@@ -18,7 +18,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.33 2008-04-01 16:40:37 francis Exp $
+# $Id: info_request_event.rb,v 1.34 2008-04-04 01:44:41 francis Exp $
class InfoRequestEvent < ActiveRecord::Base
belongs_to :info_request
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index f651aea08..84c65c4a3 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: outgoing_messages
#
@@ -21,7 +21,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.41 2008-04-01 16:40:37 francis Exp $
+# $Id: outgoing_message.rb,v 1.42 2008-04-04 01:44:41 francis Exp $
class OutgoingMessage < ActiveRecord::Base
belongs_to :info_request
diff --git a/app/models/post_redirect.rb b/app/models/post_redirect.rb
index 03fcbe564..2fbafa378 100644
--- a/app/models/post_redirect.rb
+++ b/app/models/post_redirect.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# 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.28 2008-04-01 16:40:37 francis Exp $
+# $Id: post_redirect.rb,v 1.29 2008-04-04 01:44:41 francis Exp $
require 'openssl' # for random bytes function
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 18ce07333..41b298b62 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: public_bodies
#
@@ -21,7 +21,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.51 2008-04-02 09:59:06 francis Exp $
+# $Id: public_body.rb,v 1.52 2008-04-04 01:44:41 francis Exp $
require 'csv'
require 'set'
diff --git a/app/models/public_body_tag.rb b/app/models/public_body_tag.rb
index b2e287d95..2aa41eb65 100644
--- a/app/models/public_body_tag.rb
+++ b/app/models/public_body_tag.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# 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.8 2008-04-01 16:40:37 francis Exp $
+# $Id: public_body_tag.rb,v 1.9 2008-04-04 01:44:41 francis Exp $
class PublicBodyTag < ActiveRecord::Base
validates_presence_of :public_body
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index dc395687c..84f29fa80 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -1,5 +1,5 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: track_things
#
@@ -10,6 +10,9 @@
# tracked_user_id :integer
# public_body_id :integer
# track_medium :string(255) not null
+# track_type :string(255) not null
+# created_at :datetime
+# updated_at :datetime
#
# models/track_thing.rb:
@@ -18,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.4 2008-04-04 01:35:44 francis Exp $
+# $Id: track_thing.rb,v 1.5 2008-04-04 01:44:41 francis Exp $
class TrackThing < ActiveRecord::Base
belongs_to :user, :foreign_key => 'tracking_user_id'
diff --git a/app/models/track_things_sent_email.rb b/app/models/track_things_sent_email.rb
index d177d427c..5b3ae703a 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: 49
+# Schema version: 51
#
# Table name: track_things_sent_emails
#
@@ -8,6 +8,8 @@
# info_request_event_id :integer
# user_id :integer
# public_body_id :integer
+# created_at :datetime
+# updated_at :datetime
#
# models/track_things_sent_email.rb:
@@ -16,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.1 2008-04-01 16:40:37 francis Exp $
+# $Id: track_things_sent_email.rb,v 1.2 2008-04-04 01:44:41 francis Exp $
class TrackThingsSentEmail < ActiveRecord::Base
belongs_to :info_request_event
diff --git a/app/models/user.rb b/app/models/user.rb
index 1efe0ad24..3d2ae91d3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,17 +1,18 @@
# == Schema Information
-# Schema version: 49
+# Schema version: 51
#
# Table name: users
#
-# id :integer not null, primary key
-# email :string(255) not null
-# name :string(255) not null
-# hashed_password :string(255) not null
-# salt :string(255) not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# email_confirmed :boolean default(false), not null
-# url_name :text not null
+# id :integer not null, primary key
+# email :string(255) not null
+# name :string(255) not null
+# hashed_password :string(255) not null
+# salt :string(255) not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# email_confirmed :boolean default(false), not null
+# url_name :text not null
+# last_daily_track_email :datetime default(Sat Jan 01 00:00:00 UTC 2000)
#
# models/user.rb:
@@ -20,7 +21,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.45 2008-04-03 15:29:51 francis Exp $
+# $Id: user.rb,v 1.46 2008-04-04 01:44:41 francis 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 485620805..a31e22ec3 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: 49
+# Schema version: 51
#
# 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.10 2008-04-01 16:40:37 francis Exp $
+# $Id: user_info_request_sent_alert.rb,v 1.11 2008-04-04 01:44:41 francis Exp $
class UserInfoRequestSentAlert < ActiveRecord::Base
belongs_to :user
diff --git a/db/migrate/051_add_track_things_unique_indices.rb b/db/migrate/051_add_track_things_unique_indices.rb
new file mode 100644
index 000000000..77bd3ce13
--- /dev/null
+++ b/db/migrate/051_add_track_things_unique_indices.rb
@@ -0,0 +1,11 @@
+class AddTrackThingsUniqueIndices < ActiveRecord::Migration
+ def self.up
+ add_index :track_things, [:tracking_user_id, :track_query], :unique => true
+ execute "create unique index track_things_sent_emails_unique_index on track_things_sent_emails(track_thing_id, coalesce(info_request_event_id, -1), coalesce(user_id, -1), coalesce(public_body_id, -1))"
+ end
+
+ def self.down
+ remove_index :track_things, [:tracking_user_id, :track_query]
+ execute "drop index track_things_sent_emails_unique_index"
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 33e01f82d..3a8433f47 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 => 50) do
+ActiveRecord::Schema.define(:version => 51) do
create_table "incoming_messages", :force => true do |t|
t.integer "info_request_id", :null => false
@@ -129,6 +129,8 @@ ActiveRecord::Schema.define(:version => 50) do
t.datetime "updated_at"
end
+ add_index "track_things", ["tracking_user_id", "track_query"], :name => "index_track_things_on_tracking_user_id_and_track_query", :unique => true
+
create_table "track_things_sent_emails", :force => true do |t|
t.integer "track_thing_id", :null => false
t.integer "info_request_event_id"
@@ -138,6 +140,8 @@ ActiveRecord::Schema.define(:version => 50) do
t.datetime "updated_at"
end
+ add_index "track_things_sent_emails", ["track_thing_id"], :name => "track_things_sent_emails_unique_index", :unique => true
+
create_table "user_info_request_sent_alerts", :force => true do |t|
t.integer "user_id", :null => false
t.integer "info_request_id", :null => false
diff --git a/todo.txt b/todo.txt
index c5cc6ae30..4cd374aff 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,3 +1,16 @@
+Alerts:
+
+Add unsubscribe / manage tracks page.
+Show on request who is tracking it
+
+Add you are already tracking this request error
+And show that you already tracking if you are logged in and on the request page
+
+Improve "you are now tracking this request!" flash
+
+Add unique indices, to stop duplicate tracks
+And to stop duplicate sent email things
+
FOI requests to use to test it
==============================
@@ -18,6 +31,7 @@ Search has been done
Overdue response events, so search / RSS picks up when response is late
Fix search to deal with overdue message query that TOmski asks for
+And show status on the list of recent requests - is a pain not being able to see it.
If you edit needs anim to waiting_response it doesn't edit the value in the event history, so screws up search stuff?
https://secure.mysociety.org/admin/foi/request/show/37
@@ -39,6 +53,8 @@ Consider removing login links from notifications of new responses
Later
=====
+Michael Turner's name has a space in it - strip them automatically (can see on the write message to page)
+
"Some other requets..." should have "more" link now
Now that we have LinkToHelper in mailer *objects* (not classes) call out to it