diff options
-rw-r--r-- | app/models/track_thing.rb | 4 | ||||
-rw-r--r-- | db/migrate/065_add_comments_to_user_track.rb | 14 | ||||
-rw-r--r-- | db/schema.rb | 2 | ||||
-rw-r--r-- | todo.txt | 2 |
4 files changed, 17 insertions, 5 deletions
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index f014c215a..ba2790ec4 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -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.39 2008-09-02 23:50:27 francis Exp $ +# $Id: track_thing.rb,v 1.40 2008-09-08 00:11:50 francis Exp $ class TrackThing < ActiveRecord::Base belongs_to :tracking_user, :class_name => 'User' @@ -101,7 +101,7 @@ class TrackThing < ActiveRecord::Base track_thing = TrackThing.new track_thing.track_type = 'user_updates' track_thing.tracked_user = user - track_thing.track_query = "requested_by:" + user.url_name + track_thing.track_query = "requested_by:" + user.url_name + " OR commented_by:" + user.url_name return track_thing end diff --git a/db/migrate/065_add_comments_to_user_track.rb b/db/migrate/065_add_comments_to_user_track.rb new file mode 100644 index 000000000..9c4ff2936 --- /dev/null +++ b/db/migrate/065_add_comments_to_user_track.rb @@ -0,0 +1,14 @@ +class AddCommentsToUserTrack < ActiveRecord::Migration + def self.up + TrackThing.update_all "track_query = replace(track_query, 'variety:sent ', '') where track_type in ('public_body_updates', 'user_updates')" + track_things = TrackThing.find(:all, :conditions => [ "track_type = 'user_updates'" ]) + for track_thing in track_things + track_thing.track_query = track_thing.track_query.gsub(/^requested_by:([^\s]+)$/, "requested_by:\\1 OR commented_by:\\1") + track_thing.save! + end + end + + def self.down + # XXX forget it + end +end diff --git a/db/schema.rb b/db/schema.rb index 67a0b47b2..193e50378 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 => 64) do +ActiveRecord::Schema.define(:version => 65) do create_table "acts_as_xapian_jobs", :force => true do |t| t.string "model", :null => false @@ -11,8 +11,6 @@ Next Write code to make sure the Return-Path is never foi@sandwich grrr -When tracking a person, send comments that they've made too? - Maybe move "send followup" into actions? Call this |