light-services 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gemfiles/rails_4_0.gemfile.lock +1 -1
- data/gemfiles/rails_4_1.gemfile.lock +1 -1
- data/gemfiles/rails_4_2.gemfile.lock +1 -1
- data/gemfiles/rails_5_0.gemfile.lock +1 -1
- data/gemfiles/rails_5_1.gemfile.lock +1 -1
- data/gemfiles/rails_5_2.gemfile.lock +1 -1
- data/lib/light/services/messages.rb +6 -2
- data/lib/light/services/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: 5bed2451074c95cd53c2acb1c14bfbf8d167707648804032d11c5097ac9029d5
|
4
|
+
data.tar.gz: 2ed2ee282fb7a1d39c98556e7010b883ef2aaa1e4018554922a095ec1f1f2595
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 725437fda539fe765f7836891ab89c67bb3191b33db4e8dd9df59cc85bf13b7c688f9f2894ba6d3ab451e4ac485a932c4cc17c80afd0efc5eaabdf1d1d92cf9f
|
7
|
+
data.tar.gz: ab76c737299e6d497e76a64f0dcf3a82a22f8d9ad7488b1caf68c3ad83a7b7e71c0594c8b74f3b5348e3a9f89359f50f1ccdfbb04669815a4ad34601cbb09b5d
|
@@ -15,16 +15,20 @@ module Light
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def from_record(record, rollback: true)
|
18
|
+
return unless record.errors.any?
|
19
|
+
|
18
20
|
record.errors.to_h.each do |key, message|
|
19
|
-
add(key, message)
|
21
|
+
add(key, message, rollback: false)
|
20
22
|
end
|
21
23
|
|
22
24
|
rollback! if rollback
|
23
25
|
end
|
24
26
|
|
25
27
|
def from_service(service, rollback: true)
|
28
|
+
return unless service.errors.any?
|
29
|
+
|
26
30
|
service.errors.each do |key, message|
|
27
|
-
add(key, message)
|
31
|
+
add(key, message, rollback: false)
|
28
32
|
end
|
29
33
|
|
30
34
|
rollback! if rollback
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: light-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Emelianenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|