X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/970e1a99d7dce64f0631e88c5b9f060fb48d75fe..227c402ad10059ec35394f2a960a620e5cda73af:/db/migrate/20150111192335_subscribe_old_changesets.rb?ds=sidebyside diff --git a/db/migrate/20150111192335_subscribe_old_changesets.rb b/db/migrate/20150111192335_subscribe_old_changesets.rb index cca8293f5..94b3bb565 100644 --- a/db/migrate/20150111192335_subscribe_old_changesets.rb +++ b/db/migrate/20150111192335_subscribe_old_changesets.rb @@ -1,4 +1,7 @@ -class SubscribeOldChangesets < ActiveRecord::Migration +class SubscribeOldChangesets < ActiveRecord::Migration[4.2] + class Changeset < ActiveRecord::Base + end + def up Changeset.find_each do |changeset| changeset.subscribers << changeset.user unless changeset.subscribers.exists?(changeset.user.id)