Sha256: 839a386704f5e056d7378cb6bb10298b99e1028e47c5a9b07376ede4c2c6cf0d
Contents?: true
Size: 808 Bytes
Versions: 53
Compression:
Stored size: 808 Bytes
Contents
# frozen_string_literal: true namespace :decidim_meetings do # For privacy reasons we recommend that you delete this registration form when you no longer need it. # By default this is 3 months after the meeting has passed desc "Remove registration forms belonging to meetings that have ended more than X months ago" task :clean_registration_forms, [:months] => :environment do |_t, args| args.with_defaults(months: 3) query = Decidim::Meetings::Meeting.arel_table[:end_time].lteq(Time.current - args[:months].months) old_meeting_ids = Decidim::Meetings::Meeting.where(query).pluck(:id) old_questionnaires = Decidim::Forms::Questionnaire.where(questionnaire_for_type: "Decidim::Meetings::Meeting", questionnaire_for_id: old_meeting_ids) old_questionnaires.destroy_all end end
Version data entries
53 entries across 53 versions & 1 rubygems