diff --git a/app/controllers/application_controller/policy_support.rb b/app/controllers/application_controller/policy_support.rb index e7724e07981f..076d18a6e112 100644 --- a/app/controllers/application_controller/policy_support.rb +++ b/app/controllers/application_controller/policy_support.rb @@ -85,6 +85,7 @@ def policy_sim(records = []) :url => "/#{request.parameters["controller"]}/policy_sim?continue=true") session[:policies] = {} unless params[:continue] # Clear current policies, unless continuing previous simulation records = session[:tag_items] if records.empty? && session[:tag_items].present? + session[:tag_items] = records policy_sim_build_screen(records) if @explorer @@ -228,7 +229,7 @@ def assigned_filters # Build the policy simulation screen def policy_sim_build_screen(records = []) @edit ||= {} - @tagitems = records ? records : session[:tag_db].find(session[:tag_items]) # Get the db records that are being tagged + @tagitems = records.presence || session[:tag_items] # Get the db records that are being tagged @tagitems = @tagitems.sort_by(&:name) @edit[:pol_items] = session[:tag_items] @catinfo = {} @@ -248,6 +249,7 @@ def policy_sim_build_screen(records = []) else @all_profs["