Run BackfillColumnForBroadcasts only if the column still exists (#6508)

This commit is contained in:
rhymes 2020-03-09 15:38:34 +01:00 committed by GitHub
parent 20b6c77875
commit ed66d7b181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,8 @@
module DataUpdateScripts
class BackfillColumnForBroadcasts
def run
return unless Broadcast.column_names.include?("sent")
Broadcast.find_each { |broadcast| broadcast.update!(active: broadcast.sent) }
end
end