From d5b7770c51eda8bcb0a1f2aa7850069b00a3ea76 Mon Sep 17 00:00:00 2001 From: Christian Eichhorn Date: Wed, 23 Oct 2024 08:52:53 +0200 Subject: [PATCH] Depracation warning for Rails 7.2 fixed - enum (#1386) * Update navigation_item.rb Depracation warning for Rails 7.2.11/8 fixed. in Rails 8.0. Positional arguments should be used instead: * Update navigation_item.rb support for older Rails version added --- app/models/spina/navigation_item.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/spina/navigation_item.rb b/app/models/spina/navigation_item.rb index 9153f33b8..003e72178 100644 --- a/app/models/spina/navigation_item.rb +++ b/app/models/spina/navigation_item.rb @@ -6,7 +6,11 @@ class NavigationItem < ApplicationRecord # NavigationItems can be of two different kinds: # - A link to a page # - A link to a URL - enum kind: {page: "page", url: "url"}, _suffix: true + if Rails.version >= '7.2' + enum :kind, {page: "page", url: "url"}, suffix: true + else + enum kind: {page: "page", url: "url"}, _suffix: true + end has_ancestry