From d00c33cf7fc2469ce0f4cb54e61e65e3ff77f8d1 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Wed, 30 Oct 2024 16:56:17 -0400 Subject: [PATCH] resource is an association, not an attribute, add getter/setter aliases Fixes: ManageIQ::Providers::Awx::AutomationManager::Credential model aliases `resource`, but `resource` is not an attribute. Starting in Rails 7.2, alias_attribute with non-attribute targets will raise. Use `alias_method :manager, :resource` or define the method manually --- .../manageiq/providers/awx/automation_manager/credential.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/manageiq/providers/awx/automation_manager/credential.rb b/app/models/manageiq/providers/awx/automation_manager/credential.rb index f1391c9..c7d4465 100644 --- a/app/models/manageiq/providers/awx/automation_manager/credential.rb +++ b/app/models/manageiq/providers/awx/automation_manager/credential.rb @@ -4,7 +4,8 @@ class ManageIQ::Providers::Awx::AutomationManager::Credential < ManageIQ::Provid # CUD operations in the TowerApi concern alias_attribute :manager_id, :resource_id - alias_attribute :manager, :resource + alias_method :manager, :resource + alias_method :manager=, :resource= include ManageIQ::Providers::Awx::AutomationManager::TowerApi include ProviderObjectMixin