sequel_bitemporal 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ module Sequel
8
8
  yield
9
9
  Thread.current[key] = previous
10
10
  end
11
-
11
+
12
12
  def self.point_in_time
13
13
  Thread.current[:sequel_plugins_bitemporal_point_in_time] || Time.now
14
14
  end
@@ -36,6 +36,8 @@ module Sequel
36
36
  base_alias = name ? underscore(demodulize(name)) : table_name
37
37
  @versions_alias = "#{base_alias}_versions".to_sym
38
38
  @current_version_alias = "#{base_alias}_current_version".to_sym
39
+ @audit_class = opts[:audit_class]
40
+ @audit_updated_by_method = opts[:audit_updated_by_method] || :updated_by_id
39
41
  end
40
42
  master.one_to_many :versions, class: version, key: :master_id, graph_alias_base: master.versions_alias
41
43
  master.one_to_one :current_version, class: version, key: :master_id, graph_alias_base: master.current_version_alias, :graph_block=>(proc do |j, lj, js|
@@ -91,12 +93,17 @@ module Sequel
91
93
  end
92
94
  module ClassMethods
93
95
  attr_reader :version_class, :versions_alias, :current_version_alias
96
+ attr_reader :audit_class, :audit_updated_by_method
94
97
  end
95
98
  module DatasetMethods
96
99
  end
97
100
  module InstanceMethods
98
101
  attr_reader :pending_version
99
102
 
103
+ def audited?
104
+ !!self.class.audit_class
105
+ end
106
+
100
107
  def before_validation
101
108
  prepare_pending_version
102
109
  super
@@ -125,6 +132,7 @@ module Sequel
125
132
 
126
133
  def attributes=(attributes)
127
134
  if attributes.delete(:partial_update) && !@pending_version && !new? && current_version
135
+ @current_version_values = current_version.values
128
136
  current_attributes = current_version.keys.inject({}) do |hash, key|
129
137
  hash[key] = current_version.send key
130
138
  hash
@@ -132,6 +140,8 @@ module Sequel
132
140
  current_attributes.delete :valid_from
133
141
  current_attributes.delete :valid_to
134
142
  attributes = current_attributes.merge attributes
143
+ elsif current_version
144
+ @current_version_values = current_version.values
135
145
  end
136
146
  attributes.delete :id
137
147
  @pending_version ||= model.version_class.new
@@ -212,9 +222,19 @@ module Sequel
212
222
  end
213
223
 
214
224
  def save_pending_version
225
+ current_values_for_audit = @current_version_values || {}
215
226
  pending_version.valid_to ||= Time.utc 9999
216
227
  success = add_version pending_version
217
- @pending_version = nil if success
228
+ if success
229
+ self.class.audit_class.audit(
230
+ current_values_for_audit,
231
+ pending_version.values,
232
+ pending_version.valid_from,
233
+ send(self.class.audit_updated_by_method)
234
+ ) if audited?
235
+ @current_version_values = nil
236
+ @pending_version = nil
237
+ end
218
238
  success
219
239
  end
220
240
 
@@ -229,3 +249,4 @@ module Sequel
229
249
  end
230
250
  end
231
251
  end
252
+
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "sequel_bitemporal"
6
- s.version = "0.4.4"
6
+ s.version = "0.4.5"
7
7
  s.authors = ["Joseph HALTER", "Jonathan TRON"]
8
8
  s.email = ["joseph.halter@thetalentbox.com", "jonathan.tron@thetalentbox.com"]
9
9
  s.homepage = "https://github.com/TalentBox/sequel_bitemporal"
@@ -1,40 +1,12 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "Sequel::Plugins::Bitemporal" do
4
+ include DbHelpers
4
5
  before :all do
5
- DB.drop_table(:room_versions) if DB.table_exists?(:room_versions)
6
- DB.drop_table(:rooms) if DB.table_exists?(:rooms)
7
- DB.create_table! :rooms do
8
- primary_key :id
9
- end
10
- DB.create_table! :room_versions do
11
- primary_key :id
12
- foreign_key :master_id, :rooms
13
- String :name
14
- Fixnum :price
15
- Date :created_at
16
- Date :expired_at
17
- Date :valid_from
18
- Date :valid_to
19
- end
20
- @version_class = Class.new Sequel::Model do
21
- set_dataset :room_versions
22
- def validate
23
- super
24
- errors.add(:name, "is required") unless name
25
- errors.add(:price, "is required") unless price
26
- end
27
- end
28
- closure = @version_class
29
- @master_class = Class.new Sequel::Model do
30
- set_dataset :rooms
31
- plugin :bitemporal, version_class: closure
32
- end
6
+ db_setup
33
7
  end
34
8
  before do
35
9
  Timecop.freeze 2009, 11, 28
36
- @version_class.truncate
37
- @master_class.truncate
38
10
  end
39
11
  after do
40
12
  Timecop.return
@@ -429,3 +401,105 @@ describe "Sequel::Plugins::Bitemporal" do
429
401
  Object.send :remove_const, :MyNameVersion
430
402
  end
431
403
  end
404
+
405
+ describe "Sequel::Plugins::Bitemporal", "with audit" do
406
+ include DbHelpers
407
+ before :all do
408
+ @audit_class = Class.new
409
+ db_setup audit_class: @audit_class
410
+ end
411
+ before do
412
+ Timecop.freeze 2009, 11, 28
413
+ end
414
+ after do
415
+ Timecop.return
416
+ end
417
+ it "generates a new audit on creation" do
418
+ master = @master_class.new
419
+ master.should_receive(:updated_by_id).and_return(updated_by_id = stub)
420
+ @audit_class.should_receive(:audit).with(
421
+ {},
422
+ hash_including({name: "Single Standard", price: 98}),
423
+ Date.today,
424
+ updated_by_id
425
+ )
426
+ master.update_attributes name: "Single Standard", price: 98
427
+ end
428
+ it "generates a new audit on full update" do
429
+ master = @master_class.new
430
+ master.should_receive(:updated_by_id).twice.and_return(updated_by_id = stub)
431
+ @audit_class.stub(:audit)
432
+ master.update_attributes name: "Single Standard", price: 98
433
+ @audit_class.should_receive(:audit).with(
434
+ hash_including({name: "Single Standard", price: 98}),
435
+ hash_including({name: "King size", price: 98}),
436
+ Date.today,
437
+ updated_by_id
438
+ )
439
+ master.update_attributes name: "King size", price: 98
440
+ end
441
+ it "generates a new audit on partial update" do
442
+ master = @master_class.new
443
+ master.should_receive(:updated_by_id).twice.and_return(updated_by_id = stub)
444
+ @audit_class.stub(:audit)
445
+ master.update_attributes name: "Single Standard", price: 98
446
+ @audit_class.should_receive(:audit).with(
447
+ hash_including({name: "Single Standard", price: 98}),
448
+ hash_including({name: "King size", price: 98}),
449
+ Date.today,
450
+ updated_by_id
451
+ )
452
+ master.update_attributes partial_update: true, name: "King size", price: 98
453
+ end
454
+ end
455
+ describe "Sequel::Plugins::Bitemporal", "with audit, specifying how to get the updated id" do
456
+ include DbHelpers
457
+ before :all do
458
+ @audit_class = Class.new
459
+ db_setup audit_class: @audit_class, audit_updated_by_method: :author_id
460
+ end
461
+ before do
462
+ Timecop.freeze 2009, 11, 28
463
+ end
464
+ after do
465
+ Timecop.return
466
+ end
467
+ it "generates a new audit on creation" do
468
+ master = @master_class.new
469
+ master.should_receive(:author_id).and_return(updated_by_id = stub)
470
+ @audit_class.should_receive(:audit).with(
471
+ {},
472
+ hash_including({name: "Single Standard", price: 98}),
473
+ Date.today,
474
+ updated_by_id
475
+ )
476
+ master.update_attributes name: "Single Standard", price: 98
477
+ end
478
+ it "generates a new audit on full update" do
479
+ master = @master_class.new
480
+ master.should_receive(:author_id).twice.and_return(updated_by_id = stub)
481
+ @audit_class.stub(:audit)
482
+ master.update_attributes name: "Single Standard", price: 98
483
+ @audit_class.should_receive(:audit).with(
484
+ hash_including({name: "Single Standard", price: 98}),
485
+ hash_including({name: "King size", price: 98}),
486
+ Date.today,
487
+ updated_by_id
488
+ )
489
+ master.update_attributes name: "King size", price: 98
490
+ end
491
+ it "generates a new audit on partial update" do
492
+ master = @master_class.new
493
+ master.should_receive(:author_id).twice.and_return(updated_by_id = stub)
494
+ @audit_class.stub(:audit)
495
+ master.update_attributes name: "Single Standard", price: 98
496
+ @audit_class.should_receive(:audit).with(
497
+ hash_including({name: "Single Standard", price: 98}),
498
+ hash_including({name: "King size", price: 98}),
499
+ Date.today,
500
+ updated_by_id
501
+ )
502
+ master.update_attributes partial_update: true, name: "King size", price: 98
503
+ end
504
+ end
505
+
@@ -1,41 +1,14 @@
1
+ ENV["TZ"]="UTC"
1
2
  require "spec_helper"
2
3
 
3
4
  describe "Sequel::Plugins::Bitemporal" do
4
5
  let(:hour){ 3600 }
6
+ include DbHelpers
5
7
  before :all do
6
- DB.drop_table(:room_versions) if DB.table_exists?(:room_versions)
7
- DB.drop_table(:rooms) if DB.table_exists?(:rooms)
8
- DB.create_table! :rooms do
9
- primary_key :id
10
- end
11
- DB.create_table! :room_versions do
12
- primary_key :id
13
- foreign_key :master_id, :rooms
14
- String :name
15
- Fixnum :price
16
- Time :created_at
17
- Time :expired_at
18
- Time :valid_from
19
- Time :valid_to
20
- end
21
- @version_class = Class.new Sequel::Model do
22
- set_dataset :room_versions
23
- def validate
24
- super
25
- errors.add(:name, "is required") unless name
26
- errors.add(:price, "is required") unless price
27
- end
28
- end
29
- closure = @version_class
30
- @master_class = Class.new Sequel::Model do
31
- set_dataset :rooms
32
- plugin :bitemporal, version_class: closure
33
- end
8
+ db_setup use_time: true
34
9
  end
35
10
  before do
36
11
  Timecop.freeze 2009, 11, 28, 10
37
- @version_class.truncate
38
- @master_class.truncate
39
12
  end
40
13
  after do
41
14
  Timecop.return
@@ -70,7 +43,7 @@ describe "Sequel::Plugins::Bitemporal" do
70
43
  master.should_not be_new
71
44
  master.should have_versions %Q{
72
45
  | name | price | created_at | expired_at | valid_from | valid_to | current |
73
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | MAX TIME | true |
46
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | MAX TIME | true |
74
47
  }
75
48
  end
76
49
  it "allows creating a new version in the past" do
@@ -78,7 +51,7 @@ describe "Sequel::Plugins::Bitemporal" do
78
51
  master.update_attributes name: "Single Standard", price: 98, valid_from: Time.now-hour
79
52
  master.should have_versions %Q{
80
53
  | name | price | created_at | expired_at | valid_from | valid_to | current |
81
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 09:00:00 +0100 | MAX TIME | true |
54
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 09:00:00 +0000 | MAX TIME | true |
82
55
  }
83
56
  end
84
57
  it "allows creating a new version in the future" do
@@ -86,7 +59,7 @@ describe "Sequel::Plugins::Bitemporal" do
86
59
  master.update_attributes name: "Single Standard", price: 98, valid_from: Time.now+hour
87
60
  master.should have_versions %Q{
88
61
  | name | price | created_at | expired_at | valid_from | valid_to | current |
89
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | |
62
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | |
90
63
  }
91
64
  end
92
65
  it "doesn't loose previous version in same-day update" do
@@ -95,8 +68,8 @@ describe "Sequel::Plugins::Bitemporal" do
95
68
  master.update_attributes name: "Single Standard", price: 94
96
69
  master.should have_versions %Q{
97
70
  | name | price | created_at | expired_at | valid_from | valid_to | current |
98
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
99
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | MAX TIME | true |
71
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
72
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | MAX TIME | true |
100
73
  }
101
74
  end
102
75
  it "allows partial updating based on current version" do
@@ -106,9 +79,9 @@ describe "Sequel::Plugins::Bitemporal" do
106
79
  master.update_attributes name: "King Size", partial_update: true
107
80
  master.should have_versions %Q{
108
81
  | name | price | created_at | expired_at | valid_from | valid_to | current |
109
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
110
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
111
- | King Size | 94 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | MAX TIME | true |
82
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
83
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
84
+ | King Size | 94 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | MAX TIME | true |
112
85
  }
113
86
  end
114
87
  it "expires previous version but keep it in history" do
@@ -118,9 +91,9 @@ describe "Sequel::Plugins::Bitemporal" do
118
91
  master.update_attributes price: 94, partial_update: true
119
92
  master.should have_versions %Q{
120
93
  | name | price | created_at | expired_at | valid_from | valid_to | current |
121
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
122
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
123
- | Single Standard | 94 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | true |
94
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
95
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
96
+ | Single Standard | 94 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | true |
124
97
  }
125
98
  end
126
99
  it "doesn't expire no longer valid versions" do
@@ -131,8 +104,8 @@ describe "Sequel::Plugins::Bitemporal" do
131
104
  master.update_attributes name: "Single Standard", price: 94
132
105
  master.should have_versions %Q{
133
106
  | name | price | created_at | expired_at | valid_from | valid_to | current |
134
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
135
- | Single Standard | 94 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | true |
107
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
108
+ | Single Standard | 94 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | true |
136
109
  }
137
110
  end
138
111
  it "allows shortening validity (SEE COMMENTS FOR IMPROVEMENTS)" do
@@ -142,14 +115,14 @@ describe "Sequel::Plugins::Bitemporal" do
142
115
  master.update_attributes valid_to: Time.now+10*hour, partial_update: true
143
116
  master.should have_versions %Q{
144
117
  | name | price | created_at | expired_at | valid_from | valid_to | current |
145
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
146
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
147
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | 2009-11-28 21:00:00 +0100 | true |
118
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
119
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
120
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | 2009-11-28 21:00:00 +0000 | true |
148
121
  }
149
122
  # would be even better if it could be:
150
123
  # | name | price | created_at | expired_at | valid_from | valid_to | current |
151
- # | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
152
- # | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 21:00:00 +0100 | true |
124
+ # | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
125
+ # | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 21:00:00 +0000 | true |
153
126
  end
154
127
  it "allows extending validity (SEE COMMENTS FOR IMPROVEMENTS)" do
155
128
  master = @master_class.new
@@ -157,19 +130,19 @@ describe "Sequel::Plugins::Bitemporal" do
157
130
  Timecop.freeze Time.now+hour
158
131
  master.should have_versions %Q{
159
132
  | name | price | created_at | expired_at | valid_from | valid_to | current |
160
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | true |
133
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | true |
161
134
  }
162
135
  master.update_attributes valid_to: nil, partial_update: true
163
136
  master.should have_versions %Q{
164
137
  | name | price | created_at | expired_at | valid_from | valid_to | current |
165
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
166
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
167
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | true |
138
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
139
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
140
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | true |
168
141
  }
169
142
  # would be even better if it could be:
170
143
  # | name | price | created_at | expired_at | valid_from | valid_to | current |
171
- # | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
172
- # | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | MAX TIME | true |
144
+ # | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
145
+ # | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | MAX TIME | true |
173
146
  end
174
147
  xit "doesn't do anything if unchanged" do
175
148
  end
@@ -182,11 +155,11 @@ describe "Sequel::Plugins::Bitemporal" do
182
155
  master.update_attributes name: "King Size", valid_to: nil, partial_update: true
183
156
  master.should have_versions %Q{
184
157
  | name | price | created_at | expired_at | valid_from | valid_to | current |
185
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
186
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 12:00:00 +0100 | 2009-11-28 14:00:00 +0100 | |
187
- | Single Standard | 95 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 14:00:00 +0100 | 2009-11-28 16:00:00 +0100 | |
188
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
189
- | King Size | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | 2009-11-28 12:00:00 +0100 | true |
158
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
159
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 12:00:00 +0000 | 2009-11-28 14:00:00 +0000 | |
160
+ | Single Standard | 95 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 14:00:00 +0000 | 2009-11-28 16:00:00 +0000 | |
161
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
162
+ | King Size | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | 2009-11-28 12:00:00 +0000 | true |
190
163
  }
191
164
  end
192
165
  it "overrides multiple future versions" do
@@ -198,12 +171,12 @@ describe "Sequel::Plugins::Bitemporal" do
198
171
  master.update_attributes name: "King Size", valid_to: Time.now+4*hour, partial_update: true
199
172
  master.should have_versions %Q{
200
173
  | name | price | created_at | expired_at | valid_from | valid_to | current |
201
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
202
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 12:00:00 +0100 | 2009-11-28 14:00:00 +0100 | |
203
- | Single Standard | 95 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 14:00:00 +0100 | 2009-11-28 16:00:00 +0100 | |
204
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
205
- | Single Standard | 95 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 15:00:00 +0100 | 2009-11-28 16:00:00 +0100 | |
206
- | King Size | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | 2009-11-28 15:00:00 +0100 | true |
174
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
175
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 12:00:00 +0000 | 2009-11-28 14:00:00 +0000 | |
176
+ | Single Standard | 95 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 14:00:00 +0000 | 2009-11-28 16:00:00 +0000 | |
177
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
178
+ | Single Standard | 95 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 15:00:00 +0000 | 2009-11-28 16:00:00 +0000 | |
179
+ | King Size | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | 2009-11-28 15:00:00 +0000 | true |
207
180
  }
208
181
  end
209
182
  it "overrides all future versions" do
@@ -215,11 +188,11 @@ describe "Sequel::Plugins::Bitemporal" do
215
188
  master.update_attributes name: "King Size", valid_to: Time.utc(9999), partial_update: true
216
189
  master.should have_versions %Q{
217
190
  | name | price | created_at | expired_at | valid_from | valid_to | current |
218
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
219
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 12:00:00 +0100 | 2009-11-28 14:00:00 +0100 | |
220
- | Single Standard | 95 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 14:00:00 +0100 | 2009-11-28 16:00:00 +0100 | |
221
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
222
- | King Size | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | true |
191
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
192
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 12:00:00 +0000 | 2009-11-28 14:00:00 +0000 | |
193
+ | Single Standard | 95 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 14:00:00 +0000 | 2009-11-28 16:00:00 +0000 | |
194
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
195
+ | King Size | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | true |
223
196
  }
224
197
  end
225
198
  it "allows deleting current version" do
@@ -230,10 +203,10 @@ describe "Sequel::Plugins::Bitemporal" do
230
203
  master.current_version.destroy.should be_true
231
204
  master.should have_versions %Q{
232
205
  | name | price | created_at | expired_at | valid_from | valid_to | current |
233
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
234
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
235
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | | 2009-11-28 12:00:00 +0100 | MAX TIME | |
236
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
206
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
207
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
208
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | | 2009-11-28 12:00:00 +0000 | MAX TIME | |
209
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
237
210
  }
238
211
  end
239
212
  it "allows deleting a future version" do
@@ -244,10 +217,10 @@ describe "Sequel::Plugins::Bitemporal" do
244
217
  master.versions.last.destroy.should be_true
245
218
  master.should have_versions %Q{
246
219
  | name | price | created_at | expired_at | valid_from | valid_to | current |
247
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
248
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
249
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 12:00:00 +0100 | MAX TIME | |
250
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | MAX TIME | true |
220
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
221
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
222
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 12:00:00 +0000 | MAX TIME | |
223
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | MAX TIME | true |
251
224
  }
252
225
  end
253
226
  it "allows deleting all versions" do
@@ -258,9 +231,9 @@ describe "Sequel::Plugins::Bitemporal" do
258
231
  master.destroy.should be_true
259
232
  master.should have_versions %Q{
260
233
  | name | price | created_at | expired_at | valid_from | valid_to | current |
261
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
262
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | 2009-11-28 12:00:00 +0100 | |
263
- | Single Standard | 94 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 12:00:00 +0100 | MAX TIME | |
234
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
235
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | 2009-11-28 12:00:00 +0000 | |
236
+ | Single Standard | 94 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 12:00:00 +0000 | MAX TIME | |
264
237
  }
265
238
  end
266
239
  it "allows simultaneous updates without information loss" do
@@ -272,10 +245,10 @@ describe "Sequel::Plugins::Bitemporal" do
272
245
  master2.update_attributes name: "Single Standard", price: 95
273
246
  master.should have_versions %Q{
274
247
  | name | price | created_at | expired_at | valid_from | valid_to | current |
275
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
276
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
277
- | Single Standard | 94 | 2009-11-28 11:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 11:00:00 +0100 | MAX TIME | |
278
- | Single Standard | 95 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | true |
248
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
249
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
250
+ | Single Standard | 94 | 2009-11-28 11:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 11:00:00 +0000 | MAX TIME | |
251
+ | Single Standard | 95 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | true |
279
252
  }
280
253
  end
281
254
  it "allows simultaneous cumulative updates" do
@@ -287,10 +260,10 @@ describe "Sequel::Plugins::Bitemporal" do
287
260
  master2.update_attributes name: "King Size", partial_update: true
288
261
  master.should have_versions %Q{
289
262
  | name | price | created_at | expired_at | valid_from | valid_to | current |
290
- | Single Standard | 98 | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 10:00:00 +0100 | MAX TIME | |
291
- | Single Standard | 98 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 10:00:00 +0100 | 2009-11-28 11:00:00 +0100 | |
292
- | Single Standard | 94 | 2009-11-28 11:00:00 +0100 | 2009-11-28 11:00:00 +0100 | 2009-11-28 11:00:00 +0100 | MAX TIME | |
293
- | King Size | 94 | 2009-11-28 11:00:00 +0100 | | 2009-11-28 11:00:00 +0100 | MAX TIME | true |
263
+ | Single Standard | 98 | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 10:00:00 +0000 | MAX TIME | |
264
+ | Single Standard | 98 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 10:00:00 +0000 | 2009-11-28 11:00:00 +0000 | |
265
+ | Single Standard | 94 | 2009-11-28 11:00:00 +0000 | 2009-11-28 11:00:00 +0000 | 2009-11-28 11:00:00 +0000 | MAX TIME | |
266
+ | King Size | 94 | 2009-11-28 11:00:00 +0000 | | 2009-11-28 11:00:00 +0000 | MAX TIME | true |
294
267
  }
295
268
  end
296
269
  it "allows eager loading with conditions on current version" do
@@ -365,3 +338,105 @@ describe "Sequel::Plugins::Bitemporal" do
365
338
  @master_class.with_current_or_future_versions.all.should have(2).item
366
339
  end
367
340
  end
341
+ describe "Sequel::Plugins::Bitemporal", "with audit" do
342
+ include DbHelpers
343
+ before :all do
344
+ @audit_class = Class.new
345
+ db_setup use_time: true, audit_class: @audit_class
346
+ end
347
+ before do
348
+ Timecop.freeze 2009, 11, 28, 10
349
+ end
350
+ after do
351
+ Timecop.return
352
+ end
353
+ it "generates a new audit on creation" do
354
+ master = @master_class.new
355
+ master.should_receive(:updated_by_id).and_return(updated_by_id = stub)
356
+ @audit_class.should_receive(:audit).with(
357
+ {},
358
+ hash_including({name: "Single Standard", price: 98}),
359
+ Time.now,
360
+ updated_by_id
361
+ )
362
+ master.update_attributes name: "Single Standard", price: 98
363
+ end
364
+ it "generates a new audit on full update" do
365
+ master = @master_class.new
366
+ master.should_receive(:updated_by_id).twice.and_return(updated_by_id = stub)
367
+ @audit_class.stub(:audit)
368
+ master.update_attributes name: "Single Standard", price: 98
369
+ @audit_class.should_receive(:audit).with(
370
+ hash_including({name: "Single Standard", price: 98}),
371
+ hash_including({name: "King size", price: 98}),
372
+ Time.now,
373
+ updated_by_id
374
+ )
375
+ master.update_attributes name: "King size", price: 98
376
+ end
377
+ it "generates a new audit on partial update" do
378
+ master = @master_class.new
379
+ master.should_receive(:updated_by_id).twice.and_return(updated_by_id = stub)
380
+ @audit_class.stub(:audit)
381
+ master.update_attributes name: "Single Standard", price: 98
382
+ @audit_class.should_receive(:audit).with(
383
+ hash_including({name: "Single Standard", price: 98}),
384
+ hash_including({name: "King size", price: 98}),
385
+ Time.now,
386
+ updated_by_id
387
+ )
388
+ master.update_attributes partial_update: true, name: "King size", price: 98
389
+ end
390
+ end
391
+
392
+ describe "Sequel::Plugins::Bitemporal", "with audit, specifying how to get the updated id" do
393
+ include DbHelpers
394
+ before :all do
395
+ @audit_class = Class.new
396
+ db_setup use_time: true, audit_class: @audit_class, audit_updated_by_method: :author_id
397
+ end
398
+ before do
399
+ Timecop.freeze 2009, 11, 28, 10
400
+ end
401
+ after do
402
+ Timecop.return
403
+ end
404
+ it "generates a new audit on creation" do
405
+ master = @master_class.new
406
+ master.should_receive(:author_id).and_return(updated_by_id = stub)
407
+ @audit_class.should_receive(:audit).with(
408
+ {},
409
+ hash_including({name: "Single Standard", price: 98}),
410
+ Time.now,
411
+ updated_by_id
412
+ )
413
+ master.update_attributes name: "Single Standard", price: 98
414
+ end
415
+ it "generates a new audit on full update" do
416
+ master = @master_class.new
417
+ master.should_receive(:author_id).twice.and_return(updated_by_id = stub)
418
+ @audit_class.stub(:audit)
419
+ master.update_attributes name: "Single Standard", price: 98
420
+ @audit_class.should_receive(:audit).with(
421
+ hash_including({name: "Single Standard", price: 98}),
422
+ hash_including({name: "King size", price: 98}),
423
+ Time.now,
424
+ updated_by_id
425
+ )
426
+ master.update_attributes name: "King size", price: 98
427
+ end
428
+ it "generates a new audit on partial update" do
429
+ master = @master_class.new
430
+ master.should_receive(:author_id).twice.and_return(updated_by_id = stub)
431
+ @audit_class.stub(:audit)
432
+ master.update_attributes name: "Single Standard", price: 98
433
+ @audit_class.should_receive(:audit).with(
434
+ hash_including({name: "Single Standard", price: 98}),
435
+ hash_including({name: "King size", price: 98}),
436
+ Time.now,
437
+ updated_by_id
438
+ )
439
+ master.update_attributes partial_update: true, name: "King size", price: 98
440
+ end
441
+ end
442
+
@@ -19,7 +19,7 @@ RSpec::Matchers.define :have_versions do |versions_str|
19
19
  when "MAX DATE"
20
20
  expected = "9999-01-01"
21
21
  when "MAX TIME"
22
- expected = "9999-01-01 01:00:00 +0100"
22
+ expected = "9999-01-01 00:00:00 +0000"
23
23
  end
24
24
  end
25
25
  equal = found.to_s == expected
@@ -43,4 +43,4 @@ def have_versions_parse_table(str)
43
43
  rows.collect!{|row| row[/^\s*\|(.+)\|\s*$/, 1].split("|").collect(&:strip)}
44
44
  headers = rows.shift
45
45
  rows.collect{|row| Hash[headers.zip row]}
46
- end
46
+ end
@@ -0,0 +1,49 @@
1
+ module DbHelpers
2
+ def self.included(klass)
3
+ klass.before do
4
+ db_truncate
5
+ end
6
+ end
7
+
8
+ def db_setup(opts={})
9
+ use_time = opts[:use_time]
10
+
11
+ DB.drop_table(:room_versions) if DB.table_exists?(:room_versions)
12
+ DB.drop_table(:rooms) if DB.table_exists?(:rooms)
13
+ DB.create_table! :rooms do
14
+ primary_key :id
15
+ end
16
+ DB.create_table! :room_versions do
17
+ primary_key :id
18
+ foreign_key :master_id, :rooms
19
+ String :name
20
+ Fixnum :price
21
+ send(use_time ? :Time : :Date, :created_at)
22
+ send(use_time ? :Time : :Date, :expired_at)
23
+ send(use_time ? :Time : :Date, :valid_from)
24
+ send(use_time ? :Time : :Date, :valid_to)
25
+ end
26
+ @version_class = Class.new Sequel::Model do
27
+ set_dataset :room_versions
28
+ def validate
29
+ super
30
+ errors.add(:name, "is required") unless name
31
+ errors.add(:price, "is required") unless price
32
+ end
33
+ end
34
+
35
+ bitemporal_options = {version_class: @version_class}
36
+ bitemporal_options[:audit_class] = opts[:audit_class] if opts[:audit_class]
37
+ bitemporal_options[:audit_updated_by_method] = opts[:audit_updated_by_method] if opts[:audit_updated_by_method]
38
+
39
+ @master_class = Class.new Sequel::Model do
40
+ set_dataset :rooms
41
+ plugin :bitemporal, bitemporal_options
42
+ end
43
+ end
44
+
45
+ def db_truncate
46
+ @version_class.truncate
47
+ @master_class.truncate
48
+ end
49
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_bitemporal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-16 00:00:00.000000000 Z
13
+ date: 2011-12-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sequel
17
- requirement: &2151862960 !ruby/object:Gem::Requirement
17
+ requirement: &70352181211180 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.30.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2151862960
25
+ version_requirements: *70352181211180
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sqlite3
28
- requirement: &2151878220 !ruby/object:Gem::Requirement
28
+ requirement: &70352181225300 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2151878220
36
+ version_requirements: *70352181225300
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &2151875140 !ruby/object:Gem::Requirement
39
+ requirement: &70352181242460 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 2.8.0.rc1
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2151875140
47
+ version_requirements: *70352181242460
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: timecop
50
- requirement: &2151874200 !ruby/object:Gem::Requirement
50
+ requirement: &70352181236000 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2151874200
58
+ version_requirements: *70352181236000
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rake
61
- requirement: &2151872120 !ruby/object:Gem::Requirement
61
+ requirement: &70352181253060 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2151872120
69
+ version_requirements: *70352181253060
70
70
  description: Bitemporal versioning for sequel, fully tested.
71
71
  email:
72
72
  - joseph.halter@thetalentbox.com
@@ -87,6 +87,7 @@ files:
87
87
  - spec/bitemporal_time_spec.rb
88
88
  - spec/spec_helper.rb
89
89
  - spec/support/bitemporal_matchers.rb
90
+ - spec/support/db.rb
90
91
  homepage: https://github.com/TalentBox/sequel_bitemporal
91
92
  licenses: []
92
93
  post_install_message:
@@ -101,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
102
  version: '0'
102
103
  segments:
103
104
  - 0
104
- hash: 1322715100702099733
105
+ hash: -4431153035307497923
105
106
  required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  none: false
107
108
  requirements:
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  version: '0'
111
112
  segments:
112
113
  - 0
113
- hash: 1322715100702099733
114
+ hash: -4431153035307497923
114
115
  requirements: []
115
116
  rubyforge_project:
116
117
  rubygems_version: 1.8.10
@@ -122,3 +123,4 @@ test_files:
122
123
  - spec/bitemporal_time_spec.rb
123
124
  - spec/spec_helper.rb
124
125
  - spec/support/bitemporal_matchers.rb
126
+ - spec/support/db.rb