Skip to content

Commit

Permalink
Depracation warning for Rails 7.2 fixed - enum (#1386)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
webhoernchen authored Oct 23, 2024
1 parent 386cd86 commit d5b7770
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/spina/navigation_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d5b7770

Please sign in to comment.