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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hanami/validations.rb +9 -7
- data/lib/hanami/validations/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6951dfe0b98667ad29ca42c1e3dd45546070735435dfe23a6c437c61cb5e47ca
|
4
|
+
data.tar.gz: 591391b31ec99940947f8f134ec16f95942a52ca80d13a1f7e23da29a03dfc20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9b2e15f3b82cd795ca6a0ccc902cdf5f4da854c18e9595ac4d5318afb30231d49d772ef496b8030fafdb3f563756ce6a782d456c0199480f379db83dfe20f3a
|
7
|
+
data.tar.gz: 50eaea7c4005d158d4506eda270d03d375cd6b834586dd3d59abc9d1e7ffcaa837b76260ad78016a37b32aad7fb8980d28b7e1e416def3d6711668320722ed5b
|
data/CHANGELOG.md
CHANGED
@@ -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`
|
data/lib/hanami/validations.rb
CHANGED
@@ -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
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
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
|
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
|
+
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-
|
11
|
+
date: 2019-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hanami-utils
|