Sha256: 3589f018dd15957bcbe21a7e8aa60cc834d075e6005875385bdfa37c5cede9c6

Contents?: true

Size: 682 Bytes

Versions: 4

Compression:

Stored size: 682 Bytes

Contents

# This migration comes from cmor_cms (originally 20200120141440)
class SetAllPublishableToPublished < ActiveRecord::Migration[5.2]
  def self.up
    ActiveRecord::Base.transaction do
      [
        Cmor::Cms::NavigationItem,
        Cmor::Cms::Page,
        Cmor::Cms::Partial,
        Cmor::Cms::Template
      ].each do |klass|
        klass.update_all(published_at: Time.zone.now)
      end
    end
  end

  def down.up
    ActiveRecord::Base.transaction do
      [
        Cmor::Cms::NavigationItem,
        Cmor::Cms::Page,
        Cmor::Cms::Partial,
        Cmor::Cms::Template
      ].each do |klass|
        klass.update_all(published_at: nil)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cmor_legal-0.0.51.pre spec/dummy/db/migrate/20200302113764_set_all_publishable_to_published.cmor_cms.rb
cmor_legal-0.0.50.pre spec/dummy/db/migrate/20200302113764_set_all_publishable_to_published.cmor_cms.rb
cmor_legal-0.0.49.pre spec/dummy/db/migrate/20200302113764_set_all_publishable_to_published.cmor_cms.rb
cmor_legal-0.0.48.pre spec/dummy/db/migrate/20200302113764_set_all_publishable_to_published.cmor_cms.rb