active_typed_store 2.1.0 → 2.3.0

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: 284ddabdbf758d07bc56e984971ef1cf058633a663e9a6f50072f3d795fe76cf
4
- data.tar.gz: 52cb762351e5e2132d1f3f7c16b034449474f63cb0641ddc6d7c67cb5b9778fa
3
+ metadata.gz: 14bd114be57f358f5e2f39a9ee2c554d2bc150e0b9df39b269081c2b1efc543e
4
+ data.tar.gz: a7addc73c5a5f5e2147f0b216e4109152aa5d5db44487971de45face6ece273f
5
5
  SHA512:
6
- metadata.gz: 0ff0bf66c6037e2124e2bf5513070b6dc5035afb3770457db1e729b755486828ae9cb447ce62828f94707480a08e18d164437d5961b0a0589c94e353e3396082
7
- data.tar.gz: 59b389d92a4582c6824444e874c6c20279461d467e7454e6a59ad8c5e3f705c15069f0c5d1613d593ea283614d26d261ba20c971634c81169f0840e2a0e8896d
6
+ metadata.gz: 2992b768f9374caf908ed316e5f2fd3fcd37de8495bf89988e27e47726be73c2678ccf7827f6299d901db6c282818993f0027b1113028df07cf79130f387024f
7
+ data.tar.gz: a41889669cb6d36feac7b129f66d65c747ceac9b0e08ff625fb5d598d6175757a8aa089ab1ee78725a3dcdb289745cac2a5efc09aee5fc2a8e0c16e24f445319
data/Gemfile.lock CHANGED
@@ -22,7 +22,7 @@ GIT
22
22
  PATH
23
23
  remote: .
24
24
  specs:
25
- active_typed_store (2.1.0)
25
+ active_typed_store (2.3.0)
26
26
  activemodel
27
27
  activerecord
28
28
  activesupport
@@ -8,16 +8,18 @@ module ActiveTypedStore
8
8
  end
9
9
  end
10
10
 
11
+ CUSTOM_JSON = CustomJson.new
12
+
11
13
  def typed_store(store_attribute, &)
12
14
  attrs = Attrs.new(store_attribute)
13
15
  attrs.instance_eval(&)
14
16
 
15
- # for redefined self._default_attributes
16
- def self.type_for_column(connection, column) # rubocop:disable Lint/NestedMethodDefinition
17
- return ActiveTypedStore::Store::CustomJson.new if column.name == "params"
18
-
19
- super
17
+ define_singleton_method(:inherited) do |subclass|
18
+ super(subclass)
19
+ subclass.define_attribute(store_attribute.name, CUSTOM_JSON)
20
20
  end
21
+
22
+ define_attribute store_attribute.name, CUSTOM_JSON
21
23
  store_accessor store_attribute, attrs.fields
22
24
 
23
25
  if ActiveTypedStore.config.hash_safety == :disallow_symbol_keys
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveTypedStore
4
- VERSION = "2.1.0"
4
+ VERSION = "2.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_typed_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ermolaev Andrey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-28 00:00:00.000000000 Z
11
+ date: 2025-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel