Skip to content

Commit

Permalink
Indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dalpo committed Jun 5, 2014
1 parent 8ca499c commit baf1496
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions lib/rails_admin_nestable/configuration.rb
Expand Up @@ -17,31 +17,30 @@ def list?
end

def options
if tree?
@nestable_options ||= self.tree_options
elsif list?
@nestable_options ||= self.list_options
@nestable_options ||= begin
options = self.tree_options if tree?
options = self.list_options if list?
options || {}
end

@nestable_options || {}
end

protected
def tree_options
tree.class == Hash ? TREE_DEFAULT_OPTIONS.merge(tree) : TREE_DEFAULT_OPTIONS
end

def list_options
LIST_DEFAULT_OPTIONS.merge(list.class == Hash ? list : {})
end
def tree_options
tree.class == Hash ? TREE_DEFAULT_OPTIONS.merge(tree) : TREE_DEFAULT_OPTIONS
end

def tree
@nestable_tree ||= ::RailsAdmin::Config.model(@abstract_model.model).nestable_tree
end
def list_options
LIST_DEFAULT_OPTIONS.merge(list.class == Hash ? list : {})
end

def list
@nestable_list ||= ::RailsAdmin::Config.model(@abstract_model.model).nestable_list
end
def tree
@nestable_tree ||= ::RailsAdmin::Config.model(@abstract_model.model).nestable_tree
end

def list
@nestable_list ||= ::RailsAdmin::Config.model(@abstract_model.model).nestable_list
end

end
end

0 comments on commit baf1496

Please sign in to comment.