nxt_support 0.6.2 → 0.6.3

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: e8b3ca68f9a536c651b5e6dcbe23ca93353e751a6e82b0dfe8cc34c2fe5f2e6b
4
- data.tar.gz: d000a20b0f8c8036bb6b92736429214c4a575031dca1ca2bf0131011e0dbf450
3
+ metadata.gz: df7d032c4cf505b1381021fb5118f9f2c71aee05eb1bdb4484915dc1aa9f78a8
4
+ data.tar.gz: 2cdf4c3050bcd760bc5f17bae3f3e12e550b0726eb20047e3a485d7a26853b3e
5
5
  SHA512:
6
- metadata.gz: 6183e37bab247fb40afee92b55c695b233428b91cadcfd30a6f36df07ba8856f72859cddebba385f70c16afe0e789306505fe69c809ef8852de8e2b241db981a
7
- data.tar.gz: 8a9405cd61a678f51510dfdf97a986d017fd3fb399e4c0aa56358245601ba0670621f81e5a32df912b4c1b1c489436dd98e4a2516871cfd173f2e9786cfe4535
6
+ metadata.gz: 52dad4f65484fc4b61cf6d0bdda7dab60d3b095a208f2c194d83f8254ef4bc9f1e49aee538bc2a3ab2fe1551c08cbd37e4dc6fa81a2f0a451d9a21475b818d7d
7
+ data.tar.gz: 5baa5b0e528521f30a6cd0b92674ed535a3f3b2a6b3d63ef96b448390de87cfc2d7170deba87a3bf9c6d3a3ac28ce923eaaf03cfc1e1a12630b90e6a998fd8b0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.6.3 2026-08-11
2
+ - Fix `Crystalizer#call` to return the resolved value from a custom `on_ambiguity` handler instead of always returning `unique_values.first`
3
+
1
4
  # v0.6.2 2026-04-30
2
5
  - Fix `.validate_duration` and `.validates_durations` when used in combination with `duration_attribute_accessor`
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_support (0.6.2)
4
+ nxt_support (0.6.3)
5
5
  activerecord
6
6
  activesupport
7
7
  nxt_init
@@ -32,18 +32,18 @@ GEM
32
32
  base64 (0.3.0)
33
33
  bigdecimal (4.1.2)
34
34
  coderay (1.1.3)
35
- concurrent-ruby (1.3.6)
35
+ concurrent-ruby (1.3.8)
36
36
  connection_pool (3.0.2)
37
37
  diff-lcs (1.6.2)
38
38
  drb (2.2.3)
39
- i18n (1.14.8)
39
+ i18n (1.15.2)
40
40
  concurrent-ruby (~> 1.0)
41
41
  io-console (0.8.2)
42
- json (2.19.4)
42
+ json (2.21.1)
43
43
  logger (1.7.0)
44
44
  method_source (1.1.0)
45
45
  mini_portile2 (2.8.9)
46
- minitest (6.0.5)
46
+ minitest (6.0.6)
47
47
  drb (~> 2.0)
48
48
  prism (~> 1.5)
49
49
  nxt_init (0.1.5)
@@ -72,7 +72,7 @@ GEM
72
72
  rspec-support (~> 3.13.0)
73
73
  rspec-support (3.13.7)
74
74
  securerandom (0.4.1)
75
- sqlite3 (2.9.3)
75
+ sqlite3 (2.9.5)
76
76
  mini_portile2 (~> 2.8.0)
77
77
  timeout (0.6.1)
78
78
  tzinfo (2.0.6)
@@ -7,8 +7,9 @@ module NxtSupport
7
7
  attr_init :collection, on_ambiguity: -> { default_ambiguity_handler }, with: :itself
8
8
 
9
9
  def call
10
- ensure_unanimity
11
- unique_values.first
10
+ return unique_values.first if unique_values.size == 1
11
+
12
+ on_ambiguity.arity == 1 ? on_ambiguity.call(resolved_collection) : on_ambiguity.call
12
13
  end
13
14
 
14
15
  private
@@ -24,11 +25,5 @@ module NxtSupport
24
25
  def default_ambiguity_handler
25
26
  ->(collection) { raise Error, "Values in collection are not unanimous: #{collection}" }
26
27
  end
27
-
28
- def ensure_unanimity
29
- return if unique_values.size == 1
30
-
31
- on_ambiguity.arity == 1 ? on_ambiguity.call(resolved_collection) : on_ambiguity.call
32
- end
33
28
  end
34
29
  end
@@ -1,3 +1,3 @@
1
1
  module NxtSupport
2
- VERSION = "0.6.2".freeze
2
+ VERSION = "0.6.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxt_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nils Sommer