acts_as_span 1.2.0 → 1.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b325eefc9a4503a854a5af5f9d62b23820ce5177752ee95b48128d3d63d86e7b
|
4
|
+
data.tar.gz: 89c73478dc48ca7f8f70d7e74d52a96c4660dfa4458a100b93b0a6216ce5ef5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5130c797f801bbd7e29bf89311603bf8d29c0659107e9c50e231d9c123f25dadc55793d54ba885ad08b1fe4e77486eab41516e8194133f9ceca693e2a94b398c
|
7
|
+
data.tar.gz: 7f42fe723d78b4b129b63a07677c9551ac50005d84d7ff6c5f45ccd21088a7e453122ae7fe5734c9e34636cb9ad05dbb877517e8198ef2ea64a24bc3a5ba1513
|
@@ -89,9 +89,7 @@ module ActsAsSpan
|
|
89
89
|
result = propagate
|
90
90
|
# only add new errors to the object
|
91
91
|
result.errors.each do |error, message|
|
92
|
-
|
93
|
-
object.errors.add(error, message: message)
|
94
|
-
end
|
92
|
+
object.errors.add(error) if object.errors[error].exclude? message
|
95
93
|
end
|
96
94
|
object
|
97
95
|
end
|
@@ -114,7 +112,7 @@ module ActsAsSpan
|
|
114
112
|
errors_cache.each do |message|
|
115
113
|
skip if object.errors.added?(:base, message)
|
116
114
|
|
117
|
-
object.errors.add(:base, message
|
115
|
+
object.errors.add(:base, message)
|
118
116
|
end
|
119
117
|
end
|
120
118
|
|
data/lib/acts_as_span/version.rb
CHANGED
@@ -93,7 +93,7 @@ RSpec.describe ActsAsSpan::EndDatePropagator do
|
|
93
93
|
end
|
94
94
|
it "the parent shows that grandchild's errors" do
|
95
95
|
expect(
|
96
|
-
end_date_propagator.call.errors.
|
96
|
+
end_date_propagator.call.errors.full_messages.join
|
97
97
|
).to include(
|
98
98
|
I18n.t(
|
99
99
|
'not_within_parent_date_span',
|
@@ -114,7 +114,7 @@ RSpec.describe ActsAsSpan::EndDatePropagator do
|
|
114
114
|
end
|
115
115
|
it "the parent gains all children's errors" do
|
116
116
|
expect(
|
117
|
-
end_date_propagator.call.errors.
|
117
|
+
end_date_propagator.call.errors.full_messages.join
|
118
118
|
).to include(
|
119
119
|
I18n.t(
|
120
120
|
'not_within_parent_date_span',
|
@@ -135,7 +135,7 @@ RSpec.describe ActsAsSpan::EndDatePropagator do
|
|
135
135
|
let(:include_errors) { false }
|
136
136
|
|
137
137
|
it 'does not push any child errors' do
|
138
|
-
expect(end_date_propagator.call.errors.
|
138
|
+
expect(end_date_propagator.call.errors.full_messages).to be_empty
|
139
139
|
end
|
140
140
|
end
|
141
141
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_span
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Sullivan
|
@@ -200,7 +200,7 @@ requirements: []
|
|
200
200
|
rubygems_version: 3.0.3
|
201
201
|
signing_key:
|
202
202
|
specification_version: 4
|
203
|
-
summary: acts_as_span 1.2.
|
203
|
+
summary: acts_as_span 1.2.1
|
204
204
|
test_files:
|
205
205
|
- spec/lib/acts_as_span_spec.rb
|
206
206
|
- spec/lib/delegation_spec.rb
|