Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/jsonapi/routing_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def jsonapi_resource(*resources, &_block)
options[:except] << :destroy unless options[:except].include?(:destroy) || options[:except].include?('destroy')
end

resource @resource_type, options do
resource @resource_type, **options do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 ruby2keywords

# :nocov:
if @scope.respond_to? :[]=
# Rails 4
Expand All @@ -57,7 +57,7 @@ def jsonapi_resource(*resources, &_block)
end
else
# Rails 5
jsonapi_resource_scope(SingletonResource.new(@resource_type, api_only?, @scope[:shallow], options), @resource_type) do
jsonapi_resource_scope(SingletonResource.new(@resource_type, api_only?, @scope[:shallow], **options), @resource_type) do
if block_given?
yield
else
Expand Down Expand Up @@ -119,7 +119,7 @@ def jsonapi_resources(*resources, &_block)
options[:except] << :destroy unless options[:except].include?(:destroy) || options[:except].include?('destroy')
end

resources @resource_type, options do
resources @resource_type, **options do
# :nocov:
if @scope.respond_to? :[]=
# Rails 4
Expand All @@ -131,7 +131,7 @@ def jsonapi_resources(*resources, &_block)
end
else
# Rails 5
jsonapi_resource_scope(Resource.new(@resource_type, api_only?, @scope[:shallow], options), @resource_type) do
jsonapi_resource_scope(Resource.new(@resource_type, api_only?, @scope[:shallow], **options), @resource_type) do
if block_given?
yield
else
Expand Down
Loading