dry-mutations 1.3.5 → 1.3.6
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dry/mutations/errors/error_atom.rb +8 -7
- data/lib/dry/mutations/form.rb +3 -3
- data/lib/dry/mutations/utils/procs.rb +1 -1
- data/lib/dry/mutations/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf6bbd4522768259ef715c8355d1df37d7a1b462
|
4
|
+
data.tar.gz: 799202ecb31b42566979e4580fda145824b4e338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7c4add8813f45de0fa29a66e81b880bc2c4d7718a631b4f49c50ddb355b9a99d5b57a45bf211d9312b92e0128ede6bd1b3018b4739361da44b6bb45cc581b4e
|
7
|
+
data.tar.gz: 82648f98e4ac959de064884cfc26e84cacf6491f67ff1a7d40f64cc401b9be0c8d2ed40bd8f4f41a08933121643dbddbe1eba0df80d3f3e4a537a532b4ced6eb
|
data/Gemfile.lock
CHANGED
@@ -24,13 +24,14 @@ module Dry
|
|
24
24
|
# key = msg.path.join('.')
|
25
25
|
last = msg.path.pop
|
26
26
|
tail = msg.path.inject(memo) { |acc, curr| acc[curr.to_s] ||= ::Mutations::ErrorHash.new }
|
27
|
-
tail[last
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
tail[last] = case tail[last]
|
28
|
+
when ErrorAtom then ::Mutations::ErrorArray.new << tail[last.to_s]
|
29
|
+
when NilClass then ::Mutations::ErrorArray.new
|
30
|
+
when ::Mutations::ErrorArray then tail[last.to_s]
|
31
|
+
end
|
32
|
+
key = msg.respond_to?(:predicate) ? msg.predicate : last
|
33
|
+
text = msg.respond_to?(:text) ? msg.text : msg.to_s
|
34
|
+
tail[last.to_s] << new(last, key, msg, message: text, index: idx)
|
34
35
|
# memo[key] = new(key, msg.predicate, msg, message: msg.text, index: idx)
|
35
36
|
end
|
36
37
|
end
|
data/lib/dry/mutations/form.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Dry
|
2
2
|
module Mutations
|
3
|
-
class Form < ::Dry::Validation::Form
|
4
|
-
|
3
|
+
class Form < ::Dry::Validation::Form # :nodoc:
|
4
|
+
@discarded = []
|
5
5
|
|
6
6
|
configure(&::Dry::Validation::Schema::CONFIGURATOR)
|
7
7
|
# predicates(::Dry::Mutations::Predicates)
|
8
8
|
|
9
9
|
def discarded
|
10
|
-
|
10
|
+
self.class.instance_variable_get :@discarded
|
11
11
|
end
|
12
12
|
|
13
13
|
def discarded?
|
@@ -17,7 +17,7 @@ module Dry
|
|
17
17
|
require 'hashie/dash'
|
18
18
|
require 'hashie/extensions/dash/indifferent_access'
|
19
19
|
require 'hashie/extensions/indifferent_access'
|
20
|
-
::Mutations::ErrorHash.include Hashie::Extensions::IndifferentAccess
|
20
|
+
::Mutations::ErrorHash.include Hashie::Extensions::Dash::IndifferentAccess
|
21
21
|
true
|
22
22
|
rescue LoadError => e
|
23
23
|
$stderr.puts [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-mutations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksei Matiushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|