From 0a1947ae340f2dcee4826214b5c2b6c0a19a3887 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 14 Aug 2020 10:56:20 +1000 Subject: [PATCH] Remove unused module from lib I was looking for library files that may be used but are not loaded. I would then add the missing `require` statements. But I found that this module isn't used any more. Usage removed in: 310d1b37260f49588c4302eaf529d5834005adb9 --- .rubocop_todo.yml | 1 - lib/open_food_network/model_class_from_controller_name.rb | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 lib/open_food_network/model_class_from_controller_name.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e95d9e89c6..21d7bd8851 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1037,7 +1037,6 @@ Style/FrozenStringLiteralComment: - 'lib/open_food_network/i18n_config.rb' - 'lib/open_food_network/lettuce_share_report.rb' - 'lib/open_food_network/locking.rb' - - 'lib/open_food_network/model_class_from_controller_name.rb' - 'lib/open_food_network/order_and_distributor_report.rb' - 'lib/open_food_network/order_cycle_form_applicator.rb' - 'lib/open_food_network/order_cycle_management_report.rb' diff --git a/lib/open_food_network/model_class_from_controller_name.rb b/lib/open_food_network/model_class_from_controller_name.rb deleted file mode 100644 index 97b92a18d7..0000000000 --- a/lib/open_food_network/model_class_from_controller_name.rb +++ /dev/null @@ -1,8 +0,0 @@ -module OpenFoodNetwork - module ModelClassFromControllerName - # Equivalent to CanCan's "authorize_resource :class => false" (see https://github.com/ryanb/cancan/blob/master/lib/cancan/controller_resource.rb#L146) - def model_class - self.class.to_s.sub("Controller", "").underscore.split('/').last.singularize.to_sym - end - end -end