diff options
author | Sam Bostock <sam.bostock@shopify.com> | 2018-12-10 18:20:23 -0500 |
---|---|---|
committer | Sam Bostock <sam.bostock@shopify.com> | 2018-12-10 18:20:23 -0500 |
commit | f2935b399be87d7acfc6067a73cfe11e7d4bbdec (patch) | |
tree | 5724efd14826f4f54d5ff64792a02cc4e61319b8 /guides | |
parent | d92331e3b78c4b3175b6a4430801632ff19b0bfc (diff) | |
download | rails-f2935b399be87d7acfc6067a73cfe11e7d4bbdec.tar.gz rails-f2935b399be87d7acfc6067a73cfe11e7d4bbdec.tar.bz2 rails-f2935b399be87d7acfc6067a73cfe11e7d4bbdec.zip |
Prepend module in ActiveStorage overview
[ci skip]
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 ``` |