Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permit creating a record and attaching files in a single step. # Before: User.create!(user_params.except(:avatar)).tap do |user| user.avatar.attach(user_params[:avatar]) end # After: User.create!(user_params) [Yoshiyuki Hirano & George Claghorn]
- Loading branch information
1 parent
b22ee64
commit 1d24e47
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1d24e47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your hard work with ASt, @georgeclaghorn
You just solved my feature request 😌 https://groups.google.com/forum/?hl=en#!msg/rubyonrails-core/t3FPqfc2AB8/_wJDFe-xAAAJ