store_model 1.5.0 → 1.5.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11081c035b30aac60161c2efaa4c629faf80aee154135d71cd9d1723ac0f96ea
|
4
|
+
data.tar.gz: 7ccd368264fd10a0731b81d30f708d1187f5b4571dc0e27cc374e650ab8c5d91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9842ac11b144fe8bde05bb50e0d91b6301450a8bd3f67cfdb3beca09c7d806568dc40994db42eebe929c01eca83ce8762a622eeea512bdfa0e04b92458ed33ba
|
7
|
+
data.tar.gz: 88044a2f28e0edf8a6babfd7935d1e89af2df45e6b9c831227cfabc9346e89421d53ce19e8dfcdf44c96efe93d3bf6faf28ccdf3251fb167391ccba38eef81e5
|
@@ -27,11 +27,21 @@ module StoreModel
|
|
27
27
|
when Types::Many
|
28
28
|
define_association_setter_for_many(association, options)
|
29
29
|
end
|
30
|
+
|
31
|
+
define_attr_accessor_for_destroy(association, options)
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
33
35
|
private
|
34
36
|
|
37
|
+
def define_attr_accessor_for_destroy(association, options)
|
38
|
+
return unless options&.dig(:allow_destroy)
|
39
|
+
|
40
|
+
attribute_types[association.to_s].model_klass.class_eval do
|
41
|
+
attr_accessor :_destroy
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
35
45
|
def define_association_setter_for_many(association, options)
|
36
46
|
define_method "#{association}_attributes=" do |attributes|
|
37
47
|
assign_nested_attributes_for_collection_association(association, attributes, options)
|
data/lib/store_model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: store_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DmitryTsepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|