Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reset_association method signature for singular AR associations #1854

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

cbothner
Copy link
Member

Motivation

This generated method is missing from the rbis. It's added with metaprogramming here:
https://github.com/rails/rails/blob/a2a870a7360e9590e14e1be989792cd5b607f944/activerecord/lib/active_record/associations/builder/singular_association.rb#L23-L25

And documented here:
https://github.com/rails/rails/blob/a2a870a7360e9590e14e1be989792cd5b607f944/activerecord/lib/active_record/associations.rb#L1556-L1557

Implementation

I put it right next to reload_association

Tests

Updated 馃憤馃徎

@cbothner cbothner requested a review from a team as a code owner March 29, 2024 19:57
@cbothner cbothner requested review from Morriar and st0012 March 29, 2024 19:57
@andyw8 andyw8 added the enhancement New feature or request label Mar 30, 2024
Copy link
Contributor

@KaanOzkan KaanOzkan left a comment

Choose a reason for hiding this comment

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

Thanks. Could be good to add it to the class documentation in the beginning of the file. You probably have to run bin/docs after.

@cbothner cbothner merged commit f29ea5d into main Apr 16, 2024
37 checks passed
@cbothner cbothner deleted the cbothner/add-reset_association branch April 16, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants