diff options
| author | George Claghorn <george.claghorn@gmail.com> | 2017-11-20 18:06:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-20 18:06:06 -0500 |
| commit | 1d24e47140356f136471d15e3ce3fa427f4430c2 (patch) | |
| tree | e6939039d0c925d1a489c70d95135b441aad4765 /activerecord/test/schema/schema.rb | |
| parent | b22ee64b5b30c6d5039c292235e10b24b1057f6d (diff) | |
| download | rails-1d24e47140356f136471d15e3ce3fa427f4430c2.tar.gz rails-1d24e47140356f136471d15e3ce3fa427f4430c2.tar.bz2 rails-1d24e47140356f136471d15e3ce3fa427f4430c2.zip | |
Provide attachment writers
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]
Diffstat (limited to 'activerecord/test/schema/schema.rb')
0 files changed, 0 insertions, 0 deletions
