From 0fe499d4a193f5548ffff54c12043162dd2df0d7 Mon Sep 17 00:00:00 2001 From: zmagod Date: Thu, 10 May 2018 09:04:12 +0200 Subject: [PATCH] adds the update action to repository records last_modified_by field when downstreaming assigned records --- app/controllers/my_modules_controller.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index 8810c55b5..610dbc63b 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -471,9 +471,14 @@ class MyModulesController < ApplicationController if downstream @my_module.downstream_modules.each do |my_module| - records = RepositoryRow.assigned_on_my_module(params[:selected_rows], - my_module) - my_module.repository_rows.destroy(records & my_module.repository_rows) + assigned_records = RepositoryRow.assigned_on_my_module( + params[:selected_rows], + my_module + ) + my_module.repository_rows.destroy( + assigned_records & my_module.repository_rows + ) + assigned_records.update_all(last_modified_by_id: current_user.id) end end