trabajo-afectivo/db/migrate/20210823112140_issue_2455_follow_up_assignment.rb

23 lines
787 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Issue2455FollowUpAssignment < ActiveRecord::Migration[6.0]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
Group.where(follow_up_assignment: false).find_each do |group|
group.update(follow_up_assignment: true)
end
Setting.create_if_not_exists(
title: 'Defines postmaster filter.',
name: '0009_postmaster_filter_follow_up_assignment',
area: 'Postmaster::PreFilter',
description: 'Defines postmaster filter to set the owner (based on group follow up assignment).',
options: {},
state: 'Channel::Filter::FollowUpAssignment',
frontend: false
)
end
end