OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/db/migrate/20210618125430_authors_as_w...

12 lines
373 B

class AuthorsAsWatchers < ActiveRecord::Migration[6.1]
def up
WorkPackage
.includes(:author, :project)
.find_each do |work_package|
Watcher.create(user: work_package.author, watchable: work_package)
end
end
# No down since we cannot distinguish between watchers that existed before
# and the ones that where created by the migration.
end