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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1846642dbb892be6b0a2428ee9687b90cff7edb89c0f16e5c583b6b841eee00
4
- data.tar.gz: 4a7d7b77654182e2152e855b140d2d72c6e38c244974f6937cdd6ed3cf6d8d71
3
+ metadata.gz: 34f29a54cc5ccce123dd195448e665f646c8074d8bf4fefa72a3eec1c18a94bc
4
+ data.tar.gz: 3deb3c7cd449df71ee289e7967864db8c6e223fdc6fb0f912b1a919560a6c991
5
5
  SHA512:
6
- metadata.gz: 8497c232c1f4d26dfa75df390fc0cb44b8c2ee5d375a7cb382a62e64fcb5ccc2d5cb08f632118fd84565af9d330b977df514b1073380aec9cca6e249bbadac62
7
- data.tar.gz: b3f8793814b0cefaad1325faa8fe799c19e4261947bdd5d637ba3515dc0b6dbfbf144d02ef092675e8465eff3b4528869609fdc543819be377d4238200889ddd
6
+ metadata.gz: 739f05b7c5c44430560a3392686c2f1ccc536fb4a6f529b56d567935667e10a96165de00962d89c91b5bcb8d12704fd2b475beeb5164507bc007fd3285996958
7
+ data.tar.gz: a147f51114c74db06596d2068c4ef83db35785519211a15e1dc0f345540abafc826badd75fd877beb72b5f1d4c04b34f47ea6938ac9a432e8f65f6d821985d44
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 2.1.1 (2026-01-13)
6
+
7
+ - Fix defining store attributes after schema loading. ([@palkan][])
8
+
5
9
  ## 2.1.0 (2026-01-12)
6
10
 
7
11
  - **Require Ruby 3.2+ and Rails 7.2+.**
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StoreAttribute # :nodoc:
4
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan