diff options
Diffstat (limited to 'db/migrate/20170330141723_disable_invalid_service_templates2.rb')
-rw-r--r-- | db/migrate/20170330141723_disable_invalid_service_templates2.rb | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/db/migrate/20170330141723_disable_invalid_service_templates2.rb b/db/migrate/20170330141723_disable_invalid_service_templates2.rb deleted file mode 100644 index f09f3b3e355..00000000000 --- a/db/migrate/20170330141723_disable_invalid_service_templates2.rb +++ /dev/null @@ -1,18 +0,0 @@ -# This is the same as DisableInvalidServiceTemplates. Later migrations may have -# inadvertently enabled some invalid templates again. -# -class DisableInvalidServiceTemplates2 < ActiveRecord::Migration[4.2] - DOWNTIME = false - - unless defined?(Service) - class Service < ActiveRecord::Base - self.inheritance_column = nil - end - end - - def up - Service.where(template: true, active: true).each do |template| - template.update(active: false) unless template.valid? - end - end -end |