From b116087206c381b58761fee58cdad6b620db5003 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 20 Jun 2023 11:38:13 +0200 Subject: [PATCH] Better name --- .../admin/communication/blocks/headings_controller.rb | 2 +- app/controllers/admin/communication/blocks_controller.rb | 2 +- app/services/{polymorphic.rb => polymorphic_object_finder.rb} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename app/services/{polymorphic.rb => polymorphic_object_finder.rb} (93%) diff --git a/app/controllers/admin/communication/blocks/headings_controller.rb b/app/controllers/admin/communication/blocks/headings_controller.rb index 329ee2961..e10f042ba 100644 --- a/app/controllers/admin/communication/blocks/headings_controller.rb +++ b/app/controllers/admin/communication/blocks/headings_controller.rb @@ -14,7 +14,7 @@ class Admin::Communication::Blocks::HeadingsController < Admin::Communication::B end def new - @heading.about = Polymorphic.find params, :about + @heading.about = PolymorphicObjectFinder.find params, :about breadcrumb end diff --git a/app/controllers/admin/communication/blocks_controller.rb b/app/controllers/admin/communication/blocks_controller.rb index d81db939f..7adcae290 100644 --- a/app/controllers/admin/communication/blocks_controller.rb +++ b/app/controllers/admin/communication/blocks_controller.rb @@ -15,7 +15,7 @@ class Admin::Communication::BlocksController < Admin::Communication::Application end def new - @block.about = Polymorphic.find params, :about + @block.about = PolymorphicObjectFinder.find params, :about breadcrumb end diff --git a/app/services/polymorphic.rb b/app/services/polymorphic_object_finder.rb similarity index 93% rename from app/services/polymorphic.rb rename to app/services/polymorphic_object_finder.rb index cd848e94e..47bf78dcc 100644 --- a/app/services/polymorphic.rb +++ b/app/services/polymorphic_object_finder.rb @@ -1,4 +1,4 @@ -class Polymorphic +class PolymorphicObjectFinder # @block.about = Polymorphic.find params, :about # Rails uses ActiveRecord::Inheritance#polymorphic_name to hydrate the about_type. # Example: A Block for a Communication::Website::Page::Home will have about_type = "Communication::Website::Page" -- GitLab