hanami-validations 1.3.4 → 1.3.5

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: 66a7b7aed1e386e42bd17c1840303d0cff588a2f51e0ec97241ca2b5ecc7960a
4
- data.tar.gz: 6541430022c6922cba781ace7da6a1cec73a9128dbf0111394ef3a080d2a6eee
3
+ metadata.gz: 6951dfe0b98667ad29ca42c1e3dd45546070735435dfe23a6c437c61cb5e47ca
4
+ data.tar.gz: 591391b31ec99940947f8f134ec16f95942a52ca80d13a1f7e23da29a03dfc20
5
5
  SHA512:
6
- metadata.gz: 93c49b2004993dda30dbea2af527725625bff6dc5155942f8ddf18f7914c83e25d47decc1887429ad83969637a8d8a05ab6874f0ee7735843e346fa277e9d090
7
- data.tar.gz: e9e1af41957b3e89b015a7a991b5fdeadbf14193fc79c6f6a54404c5cc479f944b8abc7d2ced45bebc42b248d887ac36c89d5f3440e9671df0fb89f0556f0f00
6
+ metadata.gz: f9b2e15f3b82cd795ca6a0ccc902cdf5f4da854c18e9595ac4d5318afb30231d49d772ef496b8030fafdb3f563756ce6a782d456c0199480f379db83dfe20f3a
7
+ data.tar.gz: 50eaea7c4005d158d4506eda270d03d375cd6b834586dd3d59abc9d1e7ffcaa837b76260ad78016a37b32aad7fb8980d28b7e1e416def3d6711668320722ed5b
@@ -1,6 +1,10 @@
1
1
  # Hanami::Validations
2
2
  Validations mixin for Ruby objects
3
3
 
4
+ ## v1.3.5 - 2019-07-26
5
+ ### Fixed
6
+ - [ippachi] Ensure I18n doesn't crash when used for inline predicates
7
+
4
8
  ## v1.3.4 - 2019-07-26
5
9
  ### Fixed
6
10
  - [Luca Guidi] Ensure to load i18n backend (including `i18n` gem), when messages engine is `:i18n`
@@ -292,11 +292,11 @@ module Hanami
292
292
 
293
293
  # @since 0.6.0
294
294
  # @api private
295
- def _schema_predicates
295
+ def _schema_predicates # rubocop:disable Metrics/CyclomaticComplexity
296
296
  return if _predicates_module.nil? && _predicates.empty?
297
297
 
298
298
  lambda do |config|
299
- config.messages = _predicates_module&.messages || DEFAULT_MESSAGES_ENGINE
299
+ config.messages = _predicates_module&.messages || @_messages || DEFAULT_MESSAGES_ENGINE
300
300
  config.messages_file = _predicates_module.messages_path unless _predicates_module.nil?
301
301
 
302
302
  require "dry/validation/messages/i18n" if config.messages == :i18n
@@ -341,11 +341,13 @@ module Hanami
341
341
  def messages
342
342
  engine = super
343
343
 
344
- if engine.respond_to?(:merge)
345
- engine
346
- else
347
- engine.messages
348
- end.merge(__messages)
344
+ messages = if engine.respond_to?(:merge)
345
+ engine
346
+ else
347
+ engine.messages
348
+ end
349
+
350
+ config.messages == :i18n ? messages : messages.merge(__messages)
349
351
  end
350
352
  end
351
353
  end
@@ -1,6 +1,6 @@
1
1
  module Hanami
2
2
  module Validations
3
3
  # @since 0.1.0
4
- VERSION = '1.3.4'.freeze
4
+ VERSION = '1.3.5'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hanami-utils