Skip to content

Commit

Permalink
Removed GenericListMixin and some related adjustments
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
AparnaKarve committed Nov 8, 2017
1 parent df57e58 commit 1f419b0
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/controllers/generic_object_definition_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 1f419b0

Please sign in to comment.