From db59493d546f52d6ede65728729bbf3eb43350c0 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Thu, 26 May 2022 10:55:10 +0100 Subject: [PATCH] Hound --- .../administrate/application_controller.rb | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/controllers/administrate/application_controller.rb b/app/controllers/administrate/application_controller.rb index 684bc01f59..82f3a3c7a1 100644 --- a/app/controllers/administrate/application_controller.rb +++ b/app/controllers/administrate/application_controller.rb @@ -107,10 +107,12 @@ def nav_link_state(resource) # Whether the named action route exists for the resource class. # - # @param resource [Class, String, Symbol] A class of resources, or the name of a class of resources. - # @param action_name [String, Symbol] The name of an action that might be possible to - # perform on a resource or resource class. - # @return [Boolean] `true` if a route exists for the resource class and the action. `false` otherwise. + # @param resource [Class, String, Symbol] A class of resources, or the name + # of a class of resources. + # @param action_name [String, Symbol] The name of an action that might be + # possible to perform on a resource or resource class. + # @return [Boolean] `true` if a route exists for the resource class and the + # action. `false` otherwise. def existing_action?(resource, action_name) routes.include?([resource.to_s.underscore.pluralize, action_name.to_s]) end @@ -225,12 +227,15 @@ def show_search_bar? ).any? { |_name, attribute| attribute.searchable? } end - # Whether the current user is authorized to perform the named action on the resource. + # Whether the current user is authorized to perform the named action on the + # resource. # - # @param _resource [ActiveRecord::Base, Class, String, Symbol] The temptative target of the action, or the name of its class. - # @param _action_name [String, Symbol] The name of an action that might be possible to - # perform on a resource or resource class. - # @return [Boolean] `true` if the current user is authorized to perform the action on the resource. `false` otherwise. + # @param _resource [ActiveRecord::Base, Class, String, Symbol] The + # temptative target of the action, or the name of its class. + # @param _action_name [String, Symbol] The name of an action that might be + # possible to perform on a resource or resource class. + # @return [Boolean] `true` if the current user is authorized to perform the + # action on the resource. `false` otherwise. def authorized_action?(_resource, _action_name) true end