Skip to content

Commit

Permalink
Support kwargs for Rails 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zealot128 committed Aug 22, 2024
1 parent a18e54f commit 30dedad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/trestle/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30dedad

Please sign in to comment.