Skip to content

Commit

Permalink
Support composite IDs
Browse files Browse the repository at this point in the history
Rails 7 supports composite primary keys, which means we need to pull the ID param with `extract_value`.
  • Loading branch information
codezomb committed Apr 21, 2024
1 parent af8947b commit 2ec333e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/implicit_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def collection

def resource
@resource ||= if params[:id].present?
collection.find(params[:id])
collection.find(params.extract_value(:id))
else
collection.new
end
Expand Down

0 comments on commit 2ec333e

Please sign in to comment.