aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/attached/macros.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change Active Storage destroy callbackskami-zh2018-01-091-2/+2
| | | | | There is concern that only blob are deleted depending on the `before_destroy` definition order which throws abort.
* Fix attaching blobs to optimistically-locked recordsGeorge Claghorn2018-01-081-2/+2
| | | | | | Explicitly declare inverse associations so ActiveStorage::Attachment touches the original record instance. Closes #31542.
* Provide attachment writersGeorge Claghorn2017-11-201-0/+8
| | | | | | | | | | | | | 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]
* Add `with_attached_*` scope to `has_one_attached` macroYoshiyuki Hirano2017-09-191-0/+6
| | | | | * For avoiding N+1 problem, added `with_attached_*` scope to `has_one_attached` macro.
* Fix replacing a singular attachmentGeorge Claghorn2017-08-291-2/+2
|
* minor tweaks in Active Storage after a walkthroughXavier Noria2017-08-151-1/+1
|
* Use frozen string literal in Active StorageKoichi ITO2017-08-121-0/+2
|
* Evaluate `@active_storage_attached_#{name}` only onceRyuta Kamizono2017-08-121-12/+8
| | | | | Currently `"@active_storage_attached_#{name}"` in `define_method` is evaluated every call. It is better to evaluate it only once.
* Fix formatting of Active Storage docs [ci skip]yuuji.yaginuma2017-08-111-13/+13
| | | | | * Use `+` instead of backquote. * Remove escape from class to be link
* Merge branch 'master' into ast-moduleDavid Heinemeier Hansson2017-08-051-3/+9
|\
| * Fix ruby warningsyuuji.yaginuma2017-08-051-2/+8
| | | | | | | | | | | | | | | | | | | | This fixes following warnings: ``` test/models/variant_test.rb:11: warning: ambiguous first argument; put parentheses or a space even after `/' operator lib/active_storage/attached/macros.rb:63: warning: instance variable @active_storage_attached_highlights not initialized lib/active_storage/attached/macros.rb:25: warning: instance variable @active_storage_attached_avatar not initialized ```
* | `module ActiveStorage`, not `ActiveStorage::Class`claudiob2017-08-041-66/+68
|/ | | | | | | | | | | | | | | | | | The reasons for this commit are: - uniformity with the other Rails libraries - (possibly) behave better with respect to autoloading - fix the index in the generated documentation Before this commit, run `rake rdoc` generates this left sidebar (ActiveStorage entries are indexed twice, both inside and outside the module): <img width="308" alt="before" src="https://user-images.githubusercontent.com/10076/28939523-7c087dec-7846-11e7-9289-38ed4a2930cd.png"> After this commit, run `rake rdoc` generates this left sidebar: (ActiveStorage entries are only indexed inside the module): <img width="303" alt="after" src="https://user-images.githubusercontent.com/10076/28939524-7c090be0-7846-11e7-8ee5-29dfecae548e.png">
* Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'Rafael Mendonça França2017-07-311-0/+76
git-subtree-dir: activestorage git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6 git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58