effective_resources 2.2.9 → 2.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/concerns/has_many_purgable.rb +6 -0
- data/lib/effective_resources/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f5258d38255a23862d15be45d82d15d68596bb42b2f31f88e5159c339e2fae8
|
|
4
|
+
data.tar.gz: c6dba77a6cdb45ec02fead79b8050cee8c482325ec772a53ffde5cea9facc754
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0f15eacdd2e1b34c85b57921dd21d01f3dfb1b22e45f17b45c2f0a066add4f0ede0856e649e843a77c016212c5133e88b780980ce48cc30c844a6e0e735149c
|
|
7
|
+
data.tar.gz: 22088c964406e716aa5d430372813632064278e1a02e1a4fa09f6845a1a8d55b5799a14ce2d29329b624fe59d7d7b1710fcb0437242c345848de21e9bd2a46cb
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
# Pass 'has_many_purgable :files, :avatar' to only allow the files and avatar to be purged.
|
|
5
5
|
# Works with effective_bootstrap file_field to display a Delete file on save checkbox
|
|
6
6
|
# to submit a _purge_attached array or association names to purge.
|
|
7
|
+
#
|
|
8
|
+
# You must permit the attribute _purge_attached: []
|
|
7
9
|
|
|
8
10
|
module HasManyPurgable
|
|
9
11
|
extend ActiveSupport::Concern
|
|
@@ -30,6 +32,10 @@ module HasManyPurgable
|
|
|
30
32
|
|
|
31
33
|
attr_accessor :_purge_attached
|
|
32
34
|
|
|
35
|
+
effective_resource do
|
|
36
|
+
_purge_attached :permitted_param
|
|
37
|
+
end
|
|
38
|
+
|
|
33
39
|
with_options(if: -> { _purge_attached.present? }) do
|
|
34
40
|
before_validation { has_many_purgable_mark_for_destruction }
|
|
35
41
|
after_save { has_many_purgable_purge }
|