annotate .svn/pristine/8c/8c1df4d73d6e3117c24c3c76b9007e79ab4c6eb2.svn-base @ 1524:82fac3dcf466
redmine-2.5-integration
Fix failure to interpret Javascript when autocompleting members for project
author |
Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
date |
Thu, 11 Sep 2014 10:24:38 +0100 |
parents |
cbb26bc654de |
children |
|
rev |
line source |
Chris@909
|
1 class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
|
Chris@909
|
2 def self.up
|
Chris@909
|
3 # Sets active users who created/replied a topic as watchers of the topic
|
Chris@909
|
4 # so that the new watch functionality at topic level doesn't affect notifications behaviour
|
Chris@909
|
5 Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" +
|
Chris@909
|
6 " SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" +
|
Chris@909
|
7 " FROM #{Message.table_name} m, #{User.table_name} u" +
|
Chris@909
|
8 " WHERE m.author_id = u.id AND u.status = 1")
|
Chris@909
|
9 end
|
Chris@909
|
10
|
Chris@909
|
11 def self.down
|
Chris@909
|
12 # Removes all message watchers
|
Chris@909
|
13 Watcher.delete_all("watchable_type = 'Message'")
|
Chris@909
|
14 end
|
Chris@909
|
15 end
|