store_attribute 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c4bd7ca51c3191e560a7cfb18a9edde7caa40c571992a26a84352da9ee5d5d0
4
- data.tar.gz: 2577ac2836e7c11b7857b5c8b98b8c3e208480b226e1ec2813ade8377324a97f
3
+ metadata.gz: d79c58e23fa0838516c2eab7130ce8f121941bb99355d9ad7e24dbcb94f231be
4
+ data.tar.gz: 70cb3d8ff0a587f726756b2d2a1d89cd162fa49e286ee343c8311c9013a4a7f9
5
5
  SHA512:
6
- metadata.gz: 6f8bcb86379b5235cde3e19b96dbbba05ec2908b409882d872fb86913f2adfc9943f6a54bc0d20f5a8b5fd1c0373edc31594bc999d07c7f229954b13d5287567
7
- data.tar.gz: cefb661c7a3e7f7add6a1ffac5eafcbae3941db2a4cc74a8e5fc5b827f10721c409ea8434730c8e6a0ba6cd706daa7e7b1276b7a52efe15bc6709e6047f6e055
6
+ metadata.gz: d15c7344b6f758cea9d405a3c5f765d4e9d6e734cae8866d44030c1788bf3c889ef6e3c2dae9bdb91976a45c7a0dbe3d4439f6cb5b81c169b97eefd1b264fc58
7
+ data.tar.gz: 8913905537ab1a151d6194b481ec46c17564515346dfe6d79cedb02281879b7e8b3ac906e7eb8dcacfcbab19d2cbe14a5d4097c2285d19827335c4420e0bf572
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.3.1 (2024-09-19)
6
+
7
+ - Populate missing defaults on user input when `store_attribute_unset_values_fallback_to_default` is true. ([@palkan][])
8
+
5
9
  ## 1.3.0 (2024-09-03) 🗓️
6
10
 
7
11
  - Fix using defaults when store attributes are inherited from a parent model. ([@palkan][])
@@ -80,6 +80,8 @@ module ActiveRecord
80
80
  accessor_types.each do |key, type|
81
81
  if hash.key?(key)
82
82
  hash[key] = type.cast(hash[key])
83
+ elsif fallback_to_default?(key)
84
+ hash[key] = built_defaults[key]
83
85
  end
84
86
  end
85
87
  hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StoreAttribute # :nodoc:
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_attribute
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-03 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord