From 30dedad6603df1b1c943b669aaca5e15bb63f653 Mon Sep 17 00:00:00 2001 From: Stefan Wienert Date: Thu, 22 Aug 2024 16:06:00 +0200 Subject: [PATCH] Support kwargs for Rails 8.0 --- lib/trestle/resource.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/trestle/resource.rb b/lib/trestle/resource.rb index bf9aa6c7..cd0c571b 100644 --- a/lib/trestle/resource.rb +++ b/lib/trestle/resource.rb @@ -133,9 +133,17 @@ def routes } Proc.new do - public_send(resource_method, resource_name, resource_options) do - admin.additional_routes.each do |block| - instance_exec(&block) + if Rails.version > "7.3" + public_send(resource_method, resource_name, **resource_options) do + admin.additional_routes.each do |block| + instance_exec(&block) + end + end + else + public_send(resource_method, resource_name, resource_options) do + admin.additional_routes.each do |block| + instance_exec(&block) + end end end end