diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-12-10 19:03:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-10 19:03:30 -0500 |
commit | cb714c3687f6b0cf13bb4a0655d7b648e37239d7 (patch) | |
tree | 5724efd14826f4f54d5ff64792a02cc4e61319b8 /guides | |
parent | d92331e3b78c4b3175b6a4430801632ff19b0bfc (diff) | |
parent | f2935b399be87d7acfc6067a73cfe11e7d4bbdec (diff) | |
download | rails-cb714c3687f6b0cf13bb4a0655d7b648e37239d7.tar.gz rails-cb714c3687f6b0cf13bb4a0655d7b648e37239d7.tar.bz2 rails-cb714c3687f6b0cf13bb4a0655d7b648e37239d7.zip |
Merge pull request #34670 from sambostock/prepend-module-in-active-storage-overview
Prepend module in ActiveStorage overview
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_storage_overview.md | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md index 65d4e2934f..51f50e8931 100644 --- a/guides/source/active_storage_overview.md +++ b/guides/source/active_storage_overview.md @@ -742,16 +742,22 @@ during the test are complete and you won't receive an error from Active Storage saying it can't find a file. ```ruby +module RemoveUploadedFiles + def after_teardown + super + remove_uploaded_files + end + + private + + def remove_uploaded_files + FileUtils.rm_rf(Rails.root.join('tmp', 'storage')) + end +end + module ActionDispatch class IntegrationTest - def remove_uploaded_files - FileUtils.rm_rf(Rails.root.join('tmp', 'storage')) - end - - def after_teardown - super - remove_uploaded_files - end + prepend RemoveUploadedFiles end end ``` |