store_attribute 2.1.0 → 2.1.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/store_attribute/active_record/store.rb +7 -0
- data/lib/store_attribute/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: 34f29a54cc5ccce123dd195448e665f646c8074d8bf4fefa72a3eec1c18a94bc
|
|
4
|
+
data.tar.gz: 3deb3c7cd449df71ee289e7967864db8c6e223fdc6fb0f912b1a919560a6c991
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 739f05b7c5c44430560a3392686c2f1ccc536fb4a6f529b56d567935667e10a96165de00962d89c91b5bcb8d12704fd2b475beeb5164507bc007fd3285996958
|
|
7
|
+
data.tar.gz: a147f51114c74db06596d2068c4ef83db35785519211a15e1dc0f345540abafc826badd75fd877beb72b5f1d4c04b34f47ea6938ac9a432e8f65f6d821985d44
|
data/CHANGELOG.md
CHANGED
|
@@ -135,6 +135,11 @@ module ActiveRecord
|
|
|
135
135
|
_local_typed_stored_attributes[store_name][:owner] = self if options.key?(:default) || !_local_typed_stored_attributes?
|
|
136
136
|
_local_typed_stored_attributes[store_name][:types][name] = [type, options]
|
|
137
137
|
|
|
138
|
+
# In case #decorate_attribute has already been invoked, add new type information right away
|
|
139
|
+
if (dtype = _local_typed_stored_attributes[store_name][:decorated_type])
|
|
140
|
+
dtype.add_typed_key(name, type, **options.symbolize_keys)
|
|
141
|
+
end
|
|
142
|
+
|
|
138
143
|
if store_attribute_register_attributes
|
|
139
144
|
cast_type =
|
|
140
145
|
if type == :value
|
|
@@ -206,6 +211,8 @@ module ActiveRecord
|
|
|
206
211
|
type.add_typed_key(name, cast_type, **options.symbolize_keys)
|
|
207
212
|
end
|
|
208
213
|
|
|
214
|
+
_local_typed_stored_attributes[attr_name][:decorated_type] = type
|
|
215
|
+
|
|
209
216
|
type
|
|
210
217
|
end
|
|
211
218
|
|