acts_as_span 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -1
- data/.travis.yml +6 -2
- data/acts_as_span.gemspec +24 -23
- data/lib/acts_as_span/end_date_propagator.rb +19 -11
- data/lib/acts_as_span/no_overlap_validator.rb +2 -1
- data/lib/acts_as_span/span_instance.rb +8 -0
- data/lib/acts_as_span/span_klass/status.rb +14 -4
- data/lib/acts_as_span/version.rb +4 -2
- data/lib/acts_as_span/within_parent_date_span_validator.rb +3 -1
- data/spec/lib/end_date_propagator_spec.rb +35 -22
- data/spec/lib/no_overlap_validator_spec.rb +10 -0
- data/spec/lib/span_instance_spec.rb +12 -0
- data/spec/lib/span_klass/status_spec.rb +38 -0
- data/spec/lib/within_parent_date_span_validator_spec.rb +11 -0
- data/spec/spec_models.rb +27 -0
- metadata +37 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59d6ed6e5f0b02d6d3683a99d62ac5f3b11ccdb5cf510f5bf1a3197e095102ff
|
4
|
+
data.tar.gz: 856975edeadab3d35def0a65e51bb6d65987fc2042cdec822d72b7c76741a9cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1ae3e3c092a528e83d7dcb2fd9ca7d601b985eaa974b6eac1c1eb2634dc4630473dc5bfcafd548d3748a602569185cd803c2f7f6551c486dddcee1905e8205
|
7
|
+
data.tar.gz: 605657a4fb0114f18018b4aab29d9c2f9c63bf87321fe7c04ceaccb7974ad064dc4112ce3b7e5b44c8b541b65680e768e60ef54e8d43e1502ec59f27f46c797d
|
data/.tool-versions
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby 2.6.
|
1
|
+
ruby 2.6.5
|
data/.travis.yml
CHANGED
@@ -2,7 +2,11 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 2.4.5
|
4
4
|
- 2.5.3
|
5
|
-
- 2.6.
|
6
|
-
|
5
|
+
- 2.6.5
|
6
|
+
|
7
|
+
# match the bundler version in the gemspec
|
8
|
+
before_install:
|
9
|
+
- gem install -v 2.1.4 bundler --no-document
|
10
|
+
- bundle _2.1.4_ install
|
7
11
|
notifications:
|
8
12
|
email: false
|
data/acts_as_span.gemspec
CHANGED
@@ -1,39 +1,40 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
1
|
+
# frozen_string_Literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
require 'acts_as_span/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
7
|
+
s.name = 'acts_as_span'
|
7
8
|
s.version = ActsAsSpan::VERSION::STRING
|
8
|
-
s.authors = [
|
9
|
-
s.email = [
|
10
|
-
s.homepage =
|
9
|
+
s.authors = ['Eric Sullivan']
|
10
|
+
s.email = ['eric.sullivan@annkissam.com']
|
11
|
+
s.homepage = 'https://github.com/annkissam/acts_as_span'
|
11
12
|
s.summary = ActsAsSpan::VERSION::SUMMARY
|
12
|
-
s.description =
|
13
|
-
s.license =
|
13
|
+
s.description = 'ActiveRecord model w/ a start_date and an end_date == ActsAsSpan'
|
14
|
+
s.license = 'MIT'
|
14
15
|
|
15
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
17
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
18
|
if s.respond_to?(:metadata)
|
18
|
-
s.metadata[
|
19
|
+
s.metadata['allowed_push_host'] = 'https://rubygems.org'
|
19
20
|
else
|
20
|
-
raise
|
21
|
-
|
21
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
22
|
+
'public gem pushes.'
|
22
23
|
end
|
23
24
|
|
24
25
|
s.files = `git ls-files`.split("\n")
|
25
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
26
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
27
|
-
s.require_paths = [
|
27
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
28
|
+
s.require_paths = %w[lib]
|
28
29
|
|
29
|
-
s.add_development_dependency
|
30
|
-
s.add_development_dependency
|
31
|
-
s.add_development_dependency
|
32
|
-
s.add_development_dependency
|
33
|
-
s.add_development_dependency
|
34
|
-
s.add_development_dependency
|
35
|
-
s.add_development_dependency
|
30
|
+
s.add_development_dependency 'bundler', '~> 2.1.4'
|
31
|
+
s.add_development_dependency 'has_siblings', '~> 0.2.7'
|
32
|
+
s.add_development_dependency 'pry-byebug'
|
33
|
+
s.add_development_dependency 'rake', '>= 12.3.3'
|
34
|
+
s.add_development_dependency 'rspec', '~> 3.0'
|
35
|
+
s.add_development_dependency 'sqlite3', '~> 1.4'
|
36
|
+
s.add_development_dependency 'temping'
|
36
37
|
|
37
|
-
s.add_runtime_dependency('activerecord', '>=
|
38
|
-
s.add_runtime_dependency('activesupport', '>=
|
38
|
+
s.add_runtime_dependency('activerecord', '>= 5.0.0')
|
39
|
+
s.add_runtime_dependency('activesupport', '>= 5.0.0')
|
39
40
|
end
|
@@ -70,12 +70,14 @@ module ActsAsSpan
|
|
70
70
|
class EndDatePropagator
|
71
71
|
attr_reader :object,
|
72
72
|
:errors_cache,
|
73
|
-
:skipped_classes
|
73
|
+
:skipped_classes,
|
74
|
+
:include_errors
|
74
75
|
|
75
|
-
def initialize(object, errors_cache: [], skipped_classes: [])
|
76
|
+
def initialize(object, errors_cache: [], skipped_classes: [], include_errors: true)
|
76
77
|
@object = object
|
77
78
|
@errors_cache = errors_cache
|
78
79
|
@skipped_classes = skipped_classes
|
80
|
+
@include_errors = include_errors
|
79
81
|
end
|
80
82
|
|
81
83
|
# class-level call: enable the usage of ActsAsSpan::EndDatePropagator.call
|
@@ -88,7 +90,7 @@ module ActsAsSpan
|
|
88
90
|
# only add new errors to the object
|
89
91
|
result.errors.each do |error, message|
|
90
92
|
unless object.errors[error].include? message
|
91
|
-
object.errors
|
93
|
+
object.errors.add(error, message: message)
|
92
94
|
end
|
93
95
|
end
|
94
96
|
object
|
@@ -108,8 +110,13 @@ module ActsAsSpan
|
|
108
110
|
save_with_errors(object, child, propagated_child)
|
109
111
|
end
|
110
112
|
|
111
|
-
|
112
|
-
|
113
|
+
if errors_cache.present?
|
114
|
+
errors_cache.each do |message|
|
115
|
+
skip if object.errors.added?(:base, message)
|
116
|
+
|
117
|
+
object.errors.add(:base, message: message)
|
118
|
+
end
|
119
|
+
end
|
113
120
|
|
114
121
|
# return the object, with any newly-added errors
|
115
122
|
object
|
@@ -119,13 +126,15 @@ module ActsAsSpan
|
|
119
126
|
def assign_end_date(child, new_end_date)
|
120
127
|
child.assign_attributes({ child.span.end_field => new_end_date })
|
121
128
|
ActsAsSpan::EndDatePropagator.call(
|
122
|
-
child,
|
129
|
+
child,
|
130
|
+
errors_cache: errors_cache,
|
131
|
+
skipped_classes: skipped_classes,
|
123
132
|
)
|
124
133
|
end
|
125
134
|
|
126
135
|
# save the child record, add errors.
|
127
136
|
def save_with_errors(object, child, propagated_child)
|
128
|
-
if object_has_errors?(propagated_child)
|
137
|
+
if object_has_errors?(propagated_child) && include_errors
|
129
138
|
errors_cache << propagation_error_message(object, child)
|
130
139
|
end
|
131
140
|
child.save
|
@@ -136,11 +145,11 @@ module ActsAsSpan
|
|
136
145
|
'propagation_failure',
|
137
146
|
scope: %i[activerecord errors messages end_date_propagator],
|
138
147
|
end_date_field_name: child.class.human_attribute_name(
|
139
|
-
child.span.end_field
|
148
|
+
child.span.end_field,
|
140
149
|
),
|
141
150
|
parent: object.model_name.human,
|
142
151
|
child: child.model_name.human,
|
143
|
-
reason: child.errors.full_messages.join('; ')
|
152
|
+
reason: child.errors.full_messages.join('; '),
|
144
153
|
)
|
145
154
|
end
|
146
155
|
|
@@ -163,8 +172,7 @@ module ActsAsSpan
|
|
163
172
|
|
164
173
|
# Use acts_as_span to determine whether a record has an end date
|
165
174
|
def should_propagate_to?(klass)
|
166
|
-
klass.respond_to?(:span) &&
|
167
|
-
@skipped_classes.exclude?(klass)
|
175
|
+
klass.respond_to?(:span) && @skipped_classes.exclude?(klass)
|
168
176
|
end
|
169
177
|
|
170
178
|
def child_associations(object)
|
@@ -42,9 +42,10 @@ module ActsAsSpan
|
|
42
42
|
|
43
43
|
return unless overlapping_records.any? && instance_scope
|
44
44
|
|
45
|
+
error_message = options[:message] || :no_overlap
|
45
46
|
record.errors.add(
|
46
47
|
:base,
|
47
|
-
|
48
|
+
error_message,
|
48
49
|
model_name: record.class.model_name.human,
|
49
50
|
model_name_plural: record.class.model_name.plural.humanize,
|
50
51
|
start_date: record.span.start_date,
|
@@ -33,5 +33,13 @@ module ActsAsSpan
|
|
33
33
|
def end_date
|
34
34
|
span_model[end_field]
|
35
35
|
end
|
36
|
+
|
37
|
+
def start_date_changed?
|
38
|
+
span_model.will_save_change_to_attribute?(start_field)
|
39
|
+
end
|
40
|
+
|
41
|
+
def end_date_changed?
|
42
|
+
span_model.will_save_change_to_attribute?(end_field)
|
43
|
+
end
|
36
44
|
end
|
37
45
|
end
|
@@ -8,10 +8,7 @@ module ActsAsSpan
|
|
8
8
|
included do
|
9
9
|
def current(query_date = Date.current)
|
10
10
|
klass.where(
|
11
|
-
(
|
12
|
-
and(
|
13
|
-
arel_table[end_field].eq(nil).or(arel_table[end_field].gteq(query_date))
|
14
|
-
)
|
11
|
+
current_condition(query_date: query_date, table: arel_table)
|
15
12
|
)
|
16
13
|
end
|
17
14
|
|
@@ -44,6 +41,19 @@ module ActsAsSpan
|
|
44
41
|
end
|
45
42
|
|
46
43
|
alias_method :current_or_future, :current_or_future_on
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
# returns an Arel node usable within an ActiveRecord `where` clause
|
48
|
+
def current_condition(query_date:, table:)
|
49
|
+
start_col = arel_table[start_field]
|
50
|
+
end_col = arel_table[end_field]
|
51
|
+
|
52
|
+
start_condition = start_col.lteq(query_date).or(start_col.eq(nil))
|
53
|
+
end_condition = end_col.eq(nil).or(end_col.gteq(query_date))
|
54
|
+
|
55
|
+
start_condition.and(end_condition)
|
56
|
+
end
|
47
57
|
end
|
48
58
|
end
|
49
59
|
end
|
data/lib/acts_as_span/version.rb
CHANGED
@@ -3,8 +3,10 @@ module ActsAsSpan
|
|
3
3
|
def validate(record)
|
4
4
|
parents = options[:parent] || options[:parents]
|
5
5
|
|
6
|
+
error_message = options[:message] || :not_within_parent_date_span
|
7
|
+
|
6
8
|
Array(parents).each do |parent|
|
7
|
-
record.errors.add(:base,
|
9
|
+
record.errors.add(:base, error_message, parent: record.class.human_attribute_name(parent)) if outside_of_parent_date_span?(record, parent)
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
@@ -3,13 +3,16 @@ require 'spec_helper'
|
|
3
3
|
RSpec.describe ActsAsSpan::EndDatePropagator do
|
4
4
|
let(:end_date_propagator) do
|
5
5
|
ActsAsSpan::EndDatePropagator.new(
|
6
|
-
base_instance, skipped_classes: skipped_classes
|
6
|
+
base_instance, skipped_classes: skipped_classes,
|
7
|
+
include_errors: include_errors
|
7
8
|
)
|
8
9
|
end
|
9
10
|
|
10
11
|
let(:base_instance) do
|
11
12
|
Base.create(end_date: initial_end_date)
|
12
13
|
end
|
14
|
+
|
15
|
+
let(:include_errors) { true }
|
13
16
|
let(:initial_end_date) { nil }
|
14
17
|
|
15
18
|
let(:other_base_instance) do
|
@@ -102,28 +105,38 @@ RSpec.describe ActsAsSpan::EndDatePropagator do
|
|
102
105
|
end
|
103
106
|
|
104
107
|
context 'when multiple child records are not valid' do
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
108
|
+
context 'when include_errors = true (default)' do
|
109
|
+
before do
|
110
|
+
child_instance.date_of_birth = base_instance.span.start_date - 1
|
111
|
+
child_instance.save(validate: false)
|
112
|
+
bird_instance.start_date = child_instance.span.start_date - 1
|
113
|
+
bird_instance.save(validate: false)
|
114
|
+
end
|
115
|
+
it "the parent gains all children's errors" do
|
116
|
+
expect(
|
117
|
+
end_date_propagator.call.errors.values.join
|
118
|
+
).to include(
|
119
|
+
I18n.t(
|
120
|
+
'not_within_parent_date_span',
|
121
|
+
parent: 'Child',
|
122
|
+
scope: %i[activerecord errors messages]
|
123
|
+
)
|
124
|
+
).and include(
|
125
|
+
I18n.t(
|
126
|
+
'not_within_parent_date_span',
|
127
|
+
parent: 'Base',
|
128
|
+
scope: %i[activerecord errors messages]
|
129
|
+
)
|
125
130
|
)
|
126
|
-
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
context 'when include_errors = false' do
|
135
|
+
let(:include_errors) { false }
|
136
|
+
|
137
|
+
it 'does not push any child errors' do
|
138
|
+
expect(end_date_propagator.call.errors.values).to be_empty
|
139
|
+
end
|
127
140
|
end
|
128
141
|
end
|
129
142
|
end
|
@@ -116,4 +116,14 @@ RSpec.describe ActsAsSpan::NoOverlapValidator do
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
end
|
119
|
+
|
120
|
+
describe 'error messages' do
|
121
|
+
let(:child_class) { OneParentChildCustom }
|
122
|
+
let(:new_child_start_date) { sister_start_date }
|
123
|
+
let(:new_child_end_date) { sister_end_date }
|
124
|
+
it 'allows using custom error messages' do
|
125
|
+
expect(new_child).not_to be_valid
|
126
|
+
expect(new_child.errors.messages[:base]).to include('Custom error message')
|
127
|
+
end
|
128
|
+
end
|
119
129
|
end
|
@@ -12,5 +12,17 @@ RSpec.describe "Span" do
|
|
12
12
|
it "should return the end_date" do
|
13
13
|
expect(span.end_date).to eq(span_model.end_date)
|
14
14
|
end
|
15
|
+
|
16
|
+
context "changed?" do
|
17
|
+
it 'returns true when start_date has changed' do
|
18
|
+
span_model.start_date = span_model.start_date + 5
|
19
|
+
expect(span.start_date_changed?).to eq(true)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'returns true when end_date has changed' do
|
23
|
+
span_model.end_date = span_model.end_date + 5
|
24
|
+
expect(span.end_date_changed?).to eq(true)
|
25
|
+
end
|
26
|
+
end
|
15
27
|
end
|
16
28
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe ActsAsSpan::SpanKlass::Status do
|
6
|
+
let(:span_klass) { ::SpanModel }
|
7
|
+
|
8
|
+
let!(:today) { Date.current }
|
9
|
+
|
10
|
+
describe '.current' do
|
11
|
+
let!(:record) do
|
12
|
+
span_klass.create(
|
13
|
+
start_date: today - 1.week,
|
14
|
+
end_date: today + 1.week,
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
subject { span_klass.current(query_date) }
|
19
|
+
|
20
|
+
context "when query_date is within the record's span" do
|
21
|
+
let(:query_date) { record.start_date + 3.days }
|
22
|
+
|
23
|
+
it { is_expected.not_to be_empty }
|
24
|
+
end
|
25
|
+
|
26
|
+
context "when query_date is before the record's span" do
|
27
|
+
let(:query_date) { record.start_date - 1.week }
|
28
|
+
|
29
|
+
it { is_expected.to be_empty }
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when query_date is after the record's span" do
|
33
|
+
let(:query_date) { record.end_date + 1.week }
|
34
|
+
|
35
|
+
it { is_expected.to be_empty }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -112,4 +112,15 @@ RSpec.describe ActsAsSpan::WithinParentDateSpanValidator do
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
115
|
+
|
116
|
+
describe 'error messages' do
|
117
|
+
let(:child_class) { OneParentChildCustom }
|
118
|
+
let(:new_child_start_date) { mama_start_date - 3.days }
|
119
|
+
let(:new_child_end_date) { mama_end_date + 5.days }
|
120
|
+
|
121
|
+
it 'allows using custom error messages' do
|
122
|
+
expect(new_child).not_to be_valid
|
123
|
+
expect(new_child.errors.messages[:base]).to include('Custom error message')
|
124
|
+
end
|
125
|
+
end
|
115
126
|
end
|
data/spec/spec_models.rb
CHANGED
@@ -47,6 +47,32 @@ Temping.create :one_parent_child do
|
|
47
47
|
validates_with ActsAsSpan::WithinParentDateSpanValidator, parents: [:mama]
|
48
48
|
end
|
49
49
|
|
50
|
+
Temping.create :one_parent_child_custom do
|
51
|
+
with_columns do |t|
|
52
|
+
t.belongs_to :mama
|
53
|
+
|
54
|
+
t.date :start_date
|
55
|
+
t.date :end_date
|
56
|
+
|
57
|
+
# every one-parent child is a favorite! ...by default
|
58
|
+
t.boolean :favorite, default: true
|
59
|
+
end
|
60
|
+
|
61
|
+
acts_as_span
|
62
|
+
|
63
|
+
def favorite?
|
64
|
+
favorite
|
65
|
+
end
|
66
|
+
|
67
|
+
belongs_to :mama
|
68
|
+
has_siblings through: [:mama]
|
69
|
+
|
70
|
+
validates_with ActsAsSpan::NoOverlapValidator,
|
71
|
+
scope: proc { siblings }, instance_scope: proc { favorite? }, message: 'Custom error message'
|
72
|
+
validates_with ActsAsSpan::WithinParentDateSpanValidator, parents: [:mama], message: 'Custom error message'
|
73
|
+
end
|
74
|
+
|
75
|
+
|
50
76
|
Temping.create :two_parent_child do
|
51
77
|
with_columns do |t|
|
52
78
|
t.belongs_to :mama
|
@@ -76,6 +102,7 @@ Temping.create :mama do
|
|
76
102
|
|
77
103
|
has_many :one_parent_children
|
78
104
|
has_many :two_parent_children
|
105
|
+
has_many :one_parent_child_customs
|
79
106
|
end
|
80
107
|
|
81
108
|
Temping.create :papa do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_span
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Sullivan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,86 +16,86 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.1.4
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.1.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: has_siblings
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.2.7
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.2.7
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pry-byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.3.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: sqlite3
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.4'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '1.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: temping
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -114,28 +114,28 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 5.0.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 5.0.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: activesupport
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 5.0.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 5.0.0
|
139
139
|
description: ActiveRecord model w/ a start_date and an end_date == ActsAsSpan
|
140
140
|
email:
|
141
141
|
- eric.sullivan@annkissam.com
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- spec/lib/span_instance/status_spec.rb
|
174
174
|
- spec/lib/span_instance/validations_spec.rb
|
175
175
|
- spec/lib/span_instance_spec.rb
|
176
|
+
- spec/lib/span_klass/status_spec.rb
|
176
177
|
- spec/lib/within_parent_date_span_validator_spec.rb
|
177
178
|
- spec/spec_helper.rb
|
178
179
|
- spec/spec_models.rb
|
@@ -181,7 +182,7 @@ licenses:
|
|
181
182
|
- MIT
|
182
183
|
metadata:
|
183
184
|
allowed_push_host: https://rubygems.org
|
184
|
-
post_install_message:
|
185
|
+
post_install_message:
|
185
186
|
rdoc_options: []
|
186
187
|
require_paths:
|
187
188
|
- lib
|
@@ -196,10 +197,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
197
|
- !ruby/object:Gem::Version
|
197
198
|
version: '0'
|
198
199
|
requirements: []
|
199
|
-
rubygems_version: 3.
|
200
|
-
signing_key:
|
200
|
+
rubygems_version: 3.0.3
|
201
|
+
signing_key:
|
201
202
|
specification_version: 4
|
202
|
-
summary: acts_as_span 1.
|
203
|
+
summary: acts_as_span 1.2.0
|
203
204
|
test_files:
|
204
205
|
- spec/lib/acts_as_span_spec.rb
|
205
206
|
- spec/lib/delegation_spec.rb
|
@@ -211,6 +212,7 @@ test_files:
|
|
211
212
|
- spec/lib/span_instance/status_spec.rb
|
212
213
|
- spec/lib/span_instance/validations_spec.rb
|
213
214
|
- spec/lib/span_instance_spec.rb
|
215
|
+
- spec/lib/span_klass/status_spec.rb
|
214
216
|
- spec/lib/within_parent_date_span_validator_spec.rb
|
215
217
|
- spec/spec_helper.rb
|
216
218
|
- spec/spec_models.rb
|