From 96987977d14166254c94b98bf1b5131b60fb086c Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Wed, 7 Dec 2022 14:35:25 +0400 Subject: [PATCH] fixed default visible column logic --- app/controllers/experiments_controller.rb | 2 +- app/models/user.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 6e64e72f3..473f51a26 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -96,7 +96,7 @@ class ExperimentsController < ApplicationController @project = @experiment.project @active_modules = @experiment.my_modules.active.order(:name) - @my_module_visible_table_columns = current_user.settings['visible_my_module_table_columns'].presence || [] + @my_module_visible_table_columns = current_user.my_module_visible_table_columns end def load_table diff --git a/app/models/user.rb b/app/models/user.rb index 8bc5c1446..b7ea13ea0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -692,6 +692,11 @@ class User < ApplicationRecord end end + def my_module_visible_table_columns + settings['visible_my_module_table_columns'].presence || + %w(id due_date age results status archived assigned tags comments) + end + protected def confirmation_required?