sequel_bitemporal 0.8.4 → 0.8.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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/sequel/plugins/bitemporal.rb +4 -1
- data/sequel_bitemporal.gemspec +1 -1
- data/spec/bitemporal_serialization_spec.rb +32 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a5b898bc4384d3300dc0c08881daafde9347ad5
|
4
|
+
data.tar.gz: 78187929210e7c8a56c7c59d898f9cfaad9b72f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85d02d52197c50ac0b46caf04f2a0a9601faee17011a510187eecb628dae05289b6f4778985fe0e7173cfe32493a1f978093bda4046774629caabe9ceb37e2b9
|
7
|
+
data.tar.gz: 6a51aefa4b3d20749631382ac4eb1a5cad02ce7e7f7796a182b9d949cd7deafa924d4d4a69988f933e002cc2bb07e89e1eaece98be0ccc1d4917a3cfb7be9816
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.3
|
@@ -487,7 +487,10 @@ module Sequel
|
|
487
487
|
to_check_columns = self.class.version_class.columns - excluded_columns
|
488
488
|
updated_by = (send(self.class.audit_updated_by_method) if audited?)
|
489
489
|
previous_values = @current_version_values || {}
|
490
|
-
current_version_values =
|
490
|
+
current_version_values = {}
|
491
|
+
pending_version.columns.each do |column|
|
492
|
+
current_version_values[column] = pending_version.public_send(column)
|
493
|
+
end
|
491
494
|
|
492
495
|
futures.each do |future_version|
|
493
496
|
attrs = {}
|
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.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"
|
@@ -39,4 +39,36 @@ describe "Sequel::Plugins::Bitemporal", :skip_jdbc_sqlite do
|
|
39
39
|
expect{ subject.restore }.to change(@version_class, :count).by 1
|
40
40
|
expect(subject.name).to eq({"test" => 1})
|
41
41
|
end
|
42
|
+
it "can propagate changes to future versions per column" do
|
43
|
+
propagate_per_column = @master_class.propagate_per_column
|
44
|
+
begin
|
45
|
+
@master_class.instance_variable_set :@propagate_per_column, true
|
46
|
+
master = @master_class.new
|
47
|
+
master.update_attributes name: {full_name: "Single Standard"}, price: 12, length: nil, width: 1
|
48
|
+
initial_today = Date.today
|
49
|
+
Timecop.freeze initial_today+1 do
|
50
|
+
master.update_attributes valid_from: initial_today+4, name: {full_name: "King Size"}, price: 15, length: 2, width: 2
|
51
|
+
expect(master.propagated_during_last_save.size).to eq(0)
|
52
|
+
end
|
53
|
+
Timecop.freeze initial_today+2 do
|
54
|
+
master.update_attributes valid_from: initial_today+3, length: 1, width: 1
|
55
|
+
expect(master.propagated_during_last_save.size).to eq(0)
|
56
|
+
end
|
57
|
+
Timecop.freeze initial_today+3 do
|
58
|
+
master.update_attributes valid_from: initial_today+2, length: 3, width: 4
|
59
|
+
expect(master.propagated_during_last_save.size).to eq(1)
|
60
|
+
end
|
61
|
+
expect(master.versions[0].name).to eq({"full_name" => "Single Standard"})
|
62
|
+
expect(master.versions[1].name).to eq({"full_name" => "Single Standard"})
|
63
|
+
expect(master.versions[2].name).to eq({"full_name" => "King Size"})
|
64
|
+
expect(master.versions[3].name).to eq({"full_name" => "Single Standard"})
|
65
|
+
expect(master.versions[4].name).to eq({"full_name" => "Single Standard"})
|
66
|
+
expect(master.versions[5].name).to eq({"full_name" => "Single Standard"})
|
67
|
+
expect(master.versions[6].name).to eq({"full_name" => "Single Standard"})
|
68
|
+
expect(master.versions[7].name).to eq({"full_name" => "Single Standard"})
|
69
|
+
ensure
|
70
|
+
@master_class.instance_variable_set :@propagate_per_column, propagate_per_column
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
42
74
|
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.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph HALTER
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sequel
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.4.5
|
123
|
+
rubygems_version: 2.4.5.1
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Bitemporal versioning for sequel.
|