2017-08-17 22:00:37 +05:30
|
|
|
# This is the same as DisableInvalidServiceTemplates. Later migrations may have
|
2019-09-04 21:01:54 +05:30
|
|
|
# inadvertently enabled some invalid templates again.
|
2017-08-17 22:00:37 +05:30
|
|
|
#
|
2019-02-15 15:39:39 +05:30
|
|
|
class DisableInvalidServiceTemplates2 < ActiveRecord::Migration[4.2]
|
2017-08-17 22:00:37 +05:30
|
|
|
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
|