rails icon indicating copy to clipboard operation
rails copied to clipboard

Handle array values of belongs_to primary_key option

Open Slotos opened this issue 2 months ago • 0 comments

Motivation / Background

Resolves #50850

Resolves #51127 by allowing users to set all query constraints on association definitions, leaving model in a state compatible with active_storage (and active_text) associations.

Detail

This PR merges handling of primary keys by belongs_to association and has_ associations into one, rendering aforementioned associations' behaviour expectedly symmetrical.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • [x] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • [x] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • [x] Tests are added or updated if you fix a bug or add a feature.
  • [x] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Slotos avatar Feb 25 '24 19:02 Slotos