Sha256: 8858bddf5b0141da8fbcfa775e53cdd4c373c527e16e248db7895670ab5556d9
Contents?: true
Size: 564 Bytes
Versions: 18
Compression:
Stored size: 564 Bytes
Contents
# frozen_string_literal: true class AddTosVersionToOrganization < ActiveRecord::Migration[5.1] class Organization < ApplicationRecord self.table_name = :decidim_organizations end def up add_column :decidim_organizations, :tos_version, :datetime Organization.find_each do |organization| tos_version = Decidim::StaticPage.find_by(slug: ["terms-and-conditions", "terms-of-service"], organization:).updated_at organization.update(tos_version:) end end def down remove_columns :decidim_organizations, :tos_version end end
Version data entries
18 entries across 18 versions & 1 rubygems