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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add accepts_nested_attributes_for support for delegated_type #41717
Add accepts_nested_attributes_for support for delegated_type #41717
Conversation
4e7082b
to
a9dfedb
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@xtr3me Could you rebase too please? I think this PR could use some more tests, but I also wouldn't put more work into this without getting approval on the base of the feature from another committer 🙏 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
67dcbdf
to
c044e86
Compare
Hi @zzak i have incorporated your suggestions and rebased with main, thank you for reviewing it 👍 |
@xtr3me Sorry for the late reply, could you squash your commits too please? |
f3594fc
to
7af2cc8
Compare
@zzak i've squashed the commits. Thank you very much for reviewing it. |
efe47cd
to
f449381
Compare
@zzak I have rebased the branch with main. Is there anything else I could do to advance this into merging it in main? |
Thanks for your patience @xtr3me I've pretty limited capacity right now, so hopefully another review can take a look 🙏 |
@dhh as the original composer of the delegated_types feature could you maybe help out by reviewing this PR and guide me on which changes are needed to get this merged in? Or do you know somebody who can/has some spare time to review this PR? 👍 |
Co-Authored-By: Zachary Scott <zzakscott@gmail.com>
f449381
to
c71a6b0
Compare
This is lovely. Thanks for working on it! |
Loved it 😍 |
How to change from Message to Comment? (with removing the Message from DB) |
Summary
This PR adds
nested_attributes_for
support todelegated_type
, this allows a developer to create and update records easily without needing to write specific methods like:Using
nested_attributes_for
allows to execute the following:Why
Nested forms based on
accepts_nested_attributes_for
are very powerful and this is the last piece missing to also be able to use it on Delegated Types.Question
Since this is a polymorphic
belongs_to
relationship, what other tests would we like to have? As it is already tested inTestNestedAttributesOnABelongsToAssociation