diff options
-rw-r--r-- | app/models/track_mailer.rb | 3 | ||||
-rw-r--r-- | db/migrate/051_add_track_things_unique_indices.rb | 8 | ||||
-rw-r--r-- | db/schema.rb | 2 | ||||
-rw-r--r-- | spec/controllers/track_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/fixtures/track_things_sent_emails.yml | 0 | ||||
-rw-r--r-- | todo.txt | 10 |
6 files changed, 12 insertions, 13 deletions
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index 919051f93..20ca104a1 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -4,7 +4,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_mailer.rb,v 1.3 2008-04-04 14:47:52 francis Exp $ +# $Id: track_mailer.rb,v 1.4 2008-04-04 14:50:51 francis Exp $ class TrackMailer < ApplicationMailer def event_digest(user, email_about_things) @@ -89,7 +89,6 @@ class TrackMailer < ApplicationMailer # Record that we've now sent those alerts to that user for track_thing, alert_results in email_about_things for result in alert_results - STDERR.puts "xxx result " + result.id.to_s track_things_sent_email = TrackThingsSentEmail.new track_things_sent_email.track_thing_id = track_thing.id if result.class.to_s == "InfoRequestEvent" diff --git a/db/migrate/051_add_track_things_unique_indices.rb b/db/migrate/051_add_track_things_unique_indices.rb index 77bd3ce13..d8810b670 100644 --- a/db/migrate/051_add_track_things_unique_indices.rb +++ b/db/migrate/051_add_track_things_unique_indices.rb @@ -1,11 +1,15 @@ 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))" + # GRRR - this index confuses Rails migrations, and it makes part of the index but not all + # of it for the schema.rb, and hence in test databases, and the test databases fail. + # I guess the query in ./activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb + # needs improving to not detect indices with complex components, rather than detect part of them. + #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" + #execute "drop index track_things_sent_emails_unique_index" end end diff --git a/db/schema.rb b/db/schema.rb index 3a8433f47..5e1982b16 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -140,8 +140,6 @@ ActiveRecord::Schema.define(:version => 51) 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/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index 295f9353a..7ab9f5b7f 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -37,7 +37,7 @@ end describe TrackController, "when sending alerts for a track" do integrate_views - fixtures :info_requests, :outgoing_messages, :incoming_messages, :info_request_events, :users, :track_things + fixtures :info_requests, :outgoing_messages, :incoming_messages, :info_request_events, :users, :track_things, :track_things_sent_emails it "should send alerts" do TrackMailer.alert_tracks diff --git a/spec/fixtures/track_things_sent_emails.yml b/spec/fixtures/track_things_sent_emails.yml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/spec/fixtures/track_things_sent_emails.yml @@ -13,11 +13,9 @@ BAILII - relationship with law courts, robots.txt ? Next ==== -Search has been done - -Overdue response events, so search / RSS picks up when response is late +"Some other requets..." should have "more" link now -Fix search to deal with overdue message query that TOmski asks for +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? @@ -42,8 +40,6 @@ 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 everywhere that it should @@ -93,6 +89,8 @@ updating Response overdue alerts are only sent first time a request goes into that state :( Store id in alert of last event which resets the due date +Overdue response events, so track alerts / RSS picks up when response is late + Overdue response alert email click through should show how many days overdue it is near where you write your reply |