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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5f5f3c3664c416d809462a0deecc2befbc7a5a9334abd728d21a7bc77d92b92
4
- data.tar.gz: 1e6406a429ab78354bdf24e853fd5365c465358aa1cd24762f5dbe149126f205
3
+ metadata.gz: 5bed2451074c95cd53c2acb1c14bfbf8d167707648804032d11c5097ac9029d5
4
+ data.tar.gz: 2ed2ee282fb7a1d39c98556e7010b883ef2aaa1e4018554922a095ec1f1f2595
5
5
  SHA512:
6
- metadata.gz: 1cfb0ce5441e9327fb27fb22093522445d0d0f6c64a549e2077d52ec03ec35a08c255940979a85eabc1c5eb7dec451c612ef842888eb2bc3ef87a0a187c71015
7
- data.tar.gz: 34586b8899e19fc41d3995d9636b0d4f14c13d2360dc5ed9eef46c30c0540eef14c4812556d79b8accefed6f2945c9ebadb371b0d43cb58f300b97fc1b43824c
6
+ metadata.gz: 725437fda539fe765f7836891ab89c67bb3191b33db4e8dd9df59cc85bf13b7c688f9f2894ba6d3ab451e4ac485a932c4cc17c80afd0efc5eaabdf1d1d92cf9f
7
+ data.tar.gz: ab76c737299e6d497e76a64f0dcf3a82a22f8d9ad7488b1caf68c3ad83a7b7e71c0594c8b74f3b5348e3a9f89359f50f1ccdfbb04669815a4ad34601cbb09b5d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.6.0)
4
+ light-services (0.6.1)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.6.0)
4
+ light-services (0.6.1)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.6.0)
4
+ light-services (0.6.1)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.6.0)
4
+ light-services (0.6.1)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.6.0)
4
+ light-services (0.6.1)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- light-services (0.6.0)
4
+ light-services (0.6.1)
5
5
  rails (> 4.0)
6
6
 
7
7
  GEM
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Light
4
4
  module Services
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
6
6
  end
7
7
  end
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.0
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-05 00:00:00.000000000 Z
11
+ date: 2018-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails