Skip to content

Commit d5b7770

Browse files
authored
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
1 parent 386cd86 commit d5b7770

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/models/spina/navigation_item.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ class NavigationItem < ApplicationRecord
66
# NavigationItems can be of two different kinds:
77
# - A link to a page
88
# - A link to a URL
9-
enum kind: {page: "page", url: "url"}, _suffix: true
9+
if Rails.version >= '7.2'
10+
enum :kind, {page: "page", url: "url"}, suffix: true
11+
else
12+
enum kind: {page: "page", url: "url"}, _suffix: true
13+
end
1014

1115
has_ancestry
1216

0 commit comments

Comments
 (0)