From 95ab35e3d6a5bcd907a4c74313df9af465892968 Mon Sep 17 00:00:00 2001 From: zmagod Date: Tue, 30 Aug 2016 12:58:52 +0200 Subject: [PATCH 1/2] cleanup update timestamp --- app/controllers/experiments_controller.rb | 2 +- app/models/experiment.rb | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 3cb4a34a1..593908380 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -66,7 +66,7 @@ class ExperimentsController < ApplicationController @experiment.update_attributes(experiment_params) @experiment.last_modified_by = current_user if @experiment.save - @experiment.touch(:workflowimg_updated_at) + # @experiment.touch(:workflowimg_updated_at) flash[:success] = t('experiments.update.success_flash', experiment: @experiment.name) redirect_to canvas_experiment_path(@experiment) diff --git a/app/models/experiment.rb b/app/models/experiment.rb index 56c40041b..022551469 100644 --- a/app/models/experiment.rb +++ b/app/models/experiment.rb @@ -199,9 +199,6 @@ class Experiment < ActiveRecord::Base # Everyhing is set, now we can move any module groups move_module_groups(updated_to_move_groups) - - # update Experiment timestamp - touch end rescue ActiveRecord::ActiveRecordError, ArgumentError, ActiveRecord::RecordNotSaved return false From a947354fb5b163c06ff40f0a1700d869b5ef06eb Mon Sep 17 00:00:00 2001 From: zmagod Date: Tue, 30 Aug 2016 13:23:48 +0200 Subject: [PATCH 2/2] fixes update times [fixes SCI-398] --- app/controllers/experiments_controller.rb | 2 +- app/models/experiment.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 593908380..3cb4a34a1 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -66,7 +66,7 @@ class ExperimentsController < ApplicationController @experiment.update_attributes(experiment_params) @experiment.last_modified_by = current_user if @experiment.save - # @experiment.touch(:workflowimg_updated_at) + @experiment.touch(:workflowimg_updated_at) flash[:success] = t('experiments.update.success_flash', experiment: @experiment.name) redirect_to canvas_experiment_path(@experiment) diff --git a/app/models/experiment.rb b/app/models/experiment.rb index 022551469..5723fdea1 100644 --- a/app/models/experiment.rb +++ b/app/models/experiment.rb @@ -321,7 +321,8 @@ class Experiment < ActiveRecord::Base file = File.open(file_location) self.workflowimg = file file.close - save! + save + touch(:workflowimg_updated_at) rescue => ex logger.error ex.message end