From 1f419b05fce244373b3066cfcc716f7d59e3fc8a Mon Sep 17 00:00:00 2001 From: Aparna Karve Date: Wed, 8 Nov 2017 10:16:54 -0800 Subject: [PATCH] Removed `GenericListMixin` and some related adjustments - Defining `index` method becomes a necessity without `GenericListMixin` in the picture - `show_list` was adjusted to build the tree first, followed by the node setup, and lastly calling the method `process_show_list` - `show` should call `super` for nested display lists, but should hand over the control to the tree via `redirect_to :action => "show_list"` for showing the top-level list records --- .../generic_object_definition_controller.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/controllers/generic_object_definition_controller.rb b/app/controllers/generic_object_definition_controller.rb index f83aef86a8f8..bb414ea8f721 100644 --- a/app/controllers/generic_object_definition_controller.rb +++ b/app/controllers/generic_object_definition_controller.rb @@ -5,7 +5,6 @@ class GenericObjectDefinitionController < ApplicationController after_action :cleanup_action after_action :set_session_data - include Mixins::GenericListMixin include Mixins::GenericSessionMixin include Mixins::GenericShowMixin @@ -15,19 +14,27 @@ def self.model GenericObjectDefinition end + def index + self.x_node = 'root' + redirect_to :action => "show_list" + end + def show_list - build_tree - super self.x_active_tree ||= :generic_object_definitions_tree self.x_node ||= 'root' + build_tree node_info(x_node) + process_show_list end def show - build_tree - super self.x_node = "god-#{to_cid(params[:id])}" - @breadcrumbs = [] + if params[:display] + super + else + @breadcrumbs = [] + redirect_to :action => "show_list" + end end def build_tree