Commit a6fc9ece authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

Merge branch 'make_sure_terminated_assignments_have_their_log_entry' into 'develop'

convert before may rake task to general cleanup job

See merge request !615
parents b73dfe26 a6d4bdb3
Pipeline #18665 failed with stage
in 35 minutes and 56 seconds
......@@ -19,7 +19,20 @@ namespace :access do
end
desc 'Set all Volunteers that where imported and created before May 2018 to intro_course = true'
task intro_true: :environment do
task cleanup_afterwards: :environment do
# Make sure terminated assignments have log entry
Assignment
.terminated
.left_joins(:assignment_log)
.where('assignment_logs.id' => nil)
.map(&:create_log_of_self)
# Make sure terminated group_assignments have log entry
GroupAssignment
.terminated
.left_joins(:group_assignment_logs)
.where('group_assignment_logs.id' => nil)
.map(&:create_log_of_self)
Volunteer
.joins(:import)
.created_before('2018-05-01')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment