From 64c733d88f1affdee21e852a83444254244160f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20=C4=8C=C3=AD=C5=BEek?= Date: Fri, 24 Mar 2017 08:52:06 +0100 Subject: [PATCH 1/2] [WIP]vm_controller and generic session mixin update --- app/controllers/mixins/generic_session_mixin.rb | 8 -------- app/controllers/vm_controller.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/mixins/generic_session_mixin.rb b/app/controllers/mixins/generic_session_mixin.rb index 1ee93650c5f..fb33d95936a 100644 --- a/app/controllers/mixins/generic_session_mixin.rb +++ b/app/controllers/mixins/generic_session_mixin.rb @@ -12,26 +12,18 @@ def get_session_data @display = session["#{prefix}_display".to_sym] @filters = session["#{prefix}_filters".to_sym] @catinfo = session["#{prefix}_catinfo".to_sym] - @cats = session["#{prefix}_cats".to_sym] @showtype = session["#{prefix}_showtype".to_sym] - @base = session["#{prefix}_compare_base".to_sym] - @polArr = session[:polArr] || "" # current tags in effect - @policy_options = session[:policy_options] || "" end def set_session_data prefix = self.class.session_key_prefix session["#{prefix}_lastaction".to_sym] = @lastaction session["#{prefix}_display".to_sym] = @display unless @display.nil? - session["#{prefix}_compare_base".to_sym] = @base session["#{prefix}_filters".to_sym] = @filters session["#{prefix}_catinfo".to_sym] = @catinfo - session["#{prefix}_cats".to_sym] = @cats session["#{prefix}_showtype".to_sym] = @showtype session[:miq_compressed] = @compressed unless @compressed.nil? session[:miq_exists_mode] = @exists_mode unless @exists_mode.nil? - session[:polArr] = @polArr unless @polArr.nil? - session[:policy_options] = @policy_options unless @policy_options.nil? end end end diff --git a/app/controllers/vm_controller.rb b/app/controllers/vm_controller.rb index b42975ffb27..416e7a57c5f 100644 --- a/app/controllers/vm_controller.rb +++ b/app/controllers/vm_controller.rb @@ -19,6 +19,16 @@ def show_list process_show_list(options) end + def get_session_data + @polArr = session[:polArr] || "" # current tags in effect + @policy_options = session[:policy_options] || "" + end + + def set_session_data + session[:polArr] = @polArr unless @polArr.nil? + session[:policy_options] = @policy_options unless @policy_options.nil? + end + def title _("Virtual Machines") end From 6b9c4a50d4e8eb2dbc27b89e259a33dea0fb426e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20=C4=8C=C3=AD=C5=BEek?= Date: Fri, 24 Mar 2017 08:56:33 +0100 Subject: [PATCH 2/2] [WIP]vm_controller added private keyword --- app/controllers/vm_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/vm_controller.rb b/app/controllers/vm_controller.rb index 416e7a57c5f..8674e0f55ec 100644 --- a/app/controllers/vm_controller.rb +++ b/app/controllers/vm_controller.rb @@ -19,6 +19,8 @@ def show_list process_show_list(options) end + private #### + def get_session_data @polArr = session[:polArr] || "" # current tags in effect @policy_options = session[:policy_options] || ""