sequel_bitemporal 0.8.1 → 0.8.2
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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/sequel/plugins/bitemporal.rb +12 -11
- data/sequel_bitemporal.gemspec +3 -3
- data/spec/bitemporal_date_spec.rb +147 -135
- data/spec/bitemporal_date_with_range_spec.rb +127 -127
- data/spec/bitemporal_serialization_spec.rb +7 -7
- data/spec/bitemporal_time_spec.rb +82 -82
- data/spec/bitemporal_time_with_range_spec.rb +85 -85
- data/spec/spec_helper.rb +0 -1
- data/spec/support/bitemporal_matchers.rb +11 -11
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 460e4d7671ccc5e7ab3de13aeba3830caacb39c7
|
4
|
+
data.tar.gz: 1899b5820129a2e99f5a51277df5027bd2da8168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 715aa18fad2846a0af8075c22ac8d7c2d659fb41e39e3542246bceb4c8adf2cd68dd96835c798ca08d3f3e957612c88bbf758a67145be910900563c8c0289135
|
7
|
+
data.tar.gz: d57fab495e283529fefb8004094509a691824c4e4faf9847ba5f5255fad3245d80d767f5193e54a177e6ab4568f69a617b120a6963859d518b013bb454437378
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.0
|
@@ -86,10 +86,11 @@ module Sequel
|
|
86
86
|
end
|
87
87
|
master.one_to_many :versions, class: version, key: :master_id, graph_alias_base: master.versions_alias
|
88
88
|
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|
|
89
|
-
t = ::Sequel::Plugins::Bitemporal.point_in_time
|
90
|
-
n = ::Sequel::Plugins::Bitemporal.now
|
89
|
+
t = Sequel.delay{ ::Sequel::Plugins::Bitemporal.point_in_time }
|
90
|
+
n = Sequel.delay{ ::Sequel::Plugins::Bitemporal.now }
|
91
91
|
if master.use_ranges
|
92
|
-
master.existence_range_contains(t, j) &
|
92
|
+
master.existence_range_contains(t, j) &
|
93
|
+
master.validity_range_contains(n, j)
|
93
94
|
else
|
94
95
|
e = Sequel.qualify j, :expired_at
|
95
96
|
(Sequel.qualify(j, :created_at) <= t) &
|
@@ -98,8 +99,8 @@ module Sequel
|
|
98
99
|
(Sequel.qualify(j, :valid_to) > n)
|
99
100
|
end
|
100
101
|
end) do |ds|
|
101
|
-
t = ::Sequel::Plugins::Bitemporal.point_in_time
|
102
|
-
n = ::Sequel::Plugins::Bitemporal.now
|
102
|
+
t = Sequel.delay{ ::Sequel::Plugins::Bitemporal.point_in_time }
|
103
|
+
n = Sequel.delay{ ::Sequel::Plugins::Bitemporal.now }
|
103
104
|
if master.use_ranges
|
104
105
|
ds.where(master.existence_range_contains(t) & master.validity_range_contains(n))
|
105
106
|
else
|
@@ -119,8 +120,8 @@ module Sequel
|
|
119
120
|
)
|
120
121
|
end
|
121
122
|
master.one_to_many :current_or_future_versions, class: version, key: :master_id, :graph_block=>(proc do |j, lj, js|
|
122
|
-
t = ::Sequel::Plugins::Bitemporal.point_in_time
|
123
|
-
n = ::Sequel::Plugins::Bitemporal.now
|
123
|
+
t = Sequel.delay{ ::Sequel::Plugins::Bitemporal.point_in_time }
|
124
|
+
n = Sequel.delay{ ::Sequel::Plugins::Bitemporal.now }
|
124
125
|
if master.use_ranges
|
125
126
|
master.existence_range_contains(t, j) &
|
126
127
|
(Sequel.qualify(j, :valid_to) > n)
|
@@ -131,10 +132,10 @@ module Sequel
|
|
131
132
|
(Sequel.qualify(j, :valid_to) > n)
|
132
133
|
end
|
133
134
|
end) do |ds|
|
134
|
-
t = ::Sequel::Plugins::Bitemporal.point_in_time
|
135
|
-
n = ::Sequel::Plugins::Bitemporal.now
|
135
|
+
t = Sequel.delay{ ::Sequel::Plugins::Bitemporal.point_in_time }
|
136
|
+
n = Sequel.delay{ ::Sequel::Plugins::Bitemporal.now }
|
136
137
|
if master.use_ranges
|
137
|
-
existence_conditions = master.existence_range_contains t
|
138
|
+
existence_conditions = master.existence_range_contains t
|
138
139
|
ds.where{ existence_conditions & (:valid_to > n) }
|
139
140
|
else
|
140
141
|
ds.where do
|
@@ -151,7 +152,7 @@ module Sequel
|
|
151
152
|
end
|
152
153
|
version.many_to_one :master, class: master, key: :master_id
|
153
154
|
version.class_eval do
|
154
|
-
if Sequel::Plugins::Bitemporal.pg_jdbc?(db)
|
155
|
+
if Sequel::Plugins::Bitemporal.pg_jdbc?(master.db)
|
155
156
|
plugin :pg_typecast_on_load, *columns
|
156
157
|
elsif Sequel::Plugins::Bitemporal.jdbc?(master.db)
|
157
158
|
plugin :typecast_on_load, *columns
|
data/sequel_bitemporal.gemspec
CHANGED
@@ -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.8.
|
6
|
+
s.version = "0.8.2"
|
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"
|
@@ -16,9 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
s.add_runtime_dependency "sequel", ">= 3.
|
19
|
+
s.add_runtime_dependency "sequel", ">= 3.41", "< 5.0"
|
20
20
|
|
21
|
-
s.add_development_dependency "rspec", "~> 2.
|
21
|
+
s.add_development_dependency "rspec", "~> 3.2.0"
|
22
22
|
s.add_development_dependency "timecop"
|
23
23
|
s.add_development_dependency "rake"
|
24
24
|
end
|