Sha256: 5bfac30fa0821b31242ebdb80e747dc88bf40393e9c7804f25ccf45402d04c67
Contents?: true
Size: 883 Bytes
Versions: 45
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true class FixMeetingsRegistrationTerms < ActiveRecord::Migration[5.2] def up reset_column_information PaperTrail.request(enabled: false) do Decidim::Meetings::Meeting.find_each do |meeting| next if meeting.component.nil? # Only user-created meetings have this problem next if meeting.official? # Since user-created meetings have no way to override the `registration_terms` field # and it's supposed to use the component defaults, # we can safely override this. meeting.registration_terms = meeting.component.settings.default_registration_terms meeting.save! end end reset_column_information end def down; end def reset_column_information Decidim::Meetings::Meeting.reset_column_information Decidim::Component.reset_column_information end end
Version data entries
45 entries across 45 versions & 1 rubygems