From b6dbbef3aa851badade684ce405b6fbc667f5321 Mon Sep 17 00:00:00 2001 From: Christian Eichhorn Date: Thu, 17 Oct 2024 11:39:33 +0200 Subject: [PATCH 1/2] Update navigation_item.rb Depracation warning for Rails 7.2.11/8 fixed. in Rails 8.0. Positional arguments should be used instead: --- app/models/spina/navigation_item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spina/navigation_item.rb b/app/models/spina/navigation_item.rb index 9153f33b8..fb99533da 100644 --- a/app/models/spina/navigation_item.rb +++ b/app/models/spina/navigation_item.rb @@ -6,7 +6,7 @@ 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 + enum :kind, {page: "page", url: "url"}, suffix: true has_ancestry From 6b157f8d542806660af6187b3589b29dae0092a7 Mon Sep 17 00:00:00 2001 From: Christian Eichhorn Date: Fri, 18 Oct 2024 09:30:02 +0200 Subject: [PATCH 2/2] 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 fb99533da..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