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: 59d6ed6e5f0b02d6d3683a99d62ac5f3b11ccdb5cf510f5bf1a3197e095102ff
4
- data.tar.gz: 856975edeadab3d35def0a65e51bb6d65987fc2042cdec822d72b7c76741a9cb
3
+ metadata.gz: b325eefc9a4503a854a5af5f9d62b23820ce5177752ee95b48128d3d63d86e7b
4
+ data.tar.gz: 89c73478dc48ca7f8f70d7e74d52a96c4660dfa4458a100b93b0a6216ce5ef5f
5
5
  SHA512:
6
- metadata.gz: cb1ae3e3c092a528e83d7dcb2fd9ca7d601b985eaa974b6eac1c1eb2634dc4630473dc5bfcafd548d3748a602569185cd803c2f7f6551c486dddcee1905e8205
7
- data.tar.gz: 605657a4fb0114f18018b4aab29d9c2f9c63bf87321fe7c04ceaccb7974ad064dc4112ce3b7e5b44c8b541b65680e768e60ef54e8d43e1502ec59f27f46c797d
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
- unless object.errors[error].include? message
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: message)
115
+ object.errors.add(:base, message)
118
116
  end
119
117
  end
120
118
 
@@ -4,7 +4,7 @@ module ActsAsSpan
4
4
  module VERSION
5
5
  MAJOR = 1
6
6
  MINOR = 2
7
- TINY = 0
7
+ TINY = 1
8
8
  PRE = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -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.values.join
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.values.join
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.values).to be_empty
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.0
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.0
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