temporal_tables 0.8.1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +53 -0
- data/.rubocop.yml +158 -0
- data/.ruby-version +1 -1
- data/.travis.yml +5 -5
- data/Gemfile +2 -0
- data/README.md +15 -5
- data/Rakefile +7 -2
- data/config.ru +2 -0
- data/gemfiles/Gemfile.6.0.mysql.lock +84 -84
- data/gemfiles/Gemfile.6.0.pg.lock +103 -98
- data/gemfiles/Gemfile.6.1.mysql.lock +180 -0
- data/gemfiles/Gemfile.6.1.pg.lock +180 -0
- data/gemfiles/{Gemfile.5.2.mysql → Gemfile.7.0.mysql} +2 -2
- data/gemfiles/Gemfile.7.0.mysql.lock +173 -0
- data/gemfiles/{Gemfile.5.2.pg → Gemfile.7.0.pg} +1 -1
- data/gemfiles/Gemfile.7.0.pg.lock +173 -0
- data/lib/temporal_tables/arel_table.rb +10 -9
- data/lib/temporal_tables/association_extensions.rb +2 -0
- data/lib/temporal_tables/connection_adapters/mysql_adapter.rb +5 -3
- data/lib/temporal_tables/connection_adapters/postgresql_adapter.rb +5 -3
- data/lib/temporal_tables/history_hook.rb +8 -5
- data/lib/temporal_tables/preloader_extensions.rb +2 -0
- data/lib/temporal_tables/reflection_extensions.rb +11 -14
- data/lib/temporal_tables/relation_extensions.rb +11 -24
- data/lib/temporal_tables/temporal_adapter.rb +77 -90
- data/lib/temporal_tables/temporal_class.rb +29 -28
- data/lib/temporal_tables/version.rb +3 -1
- data/lib/temporal_tables/whodunnit.rb +5 -3
- data/lib/temporal_tables.rb +42 -32
- data/spec/basic_history_spec.rb +52 -43
- data/spec/internal/app/models/broom.rb +2 -0
- data/spec/internal/app/models/cat.rb +3 -1
- data/spec/internal/app/models/cat_life.rb +2 -0
- data/spec/internal/app/models/coven.rb +2 -0
- data/spec/internal/app/models/flying_machine.rb +2 -0
- data/spec/internal/app/models/person.rb +2 -0
- data/spec/internal/app/models/rocket_broom.rb +2 -0
- data/spec/internal/app/models/wart.rb +3 -1
- data/spec/internal/config/database.ci.yml +12 -0
- data/spec/internal/db/schema.rb +8 -4
- data/spec/spec_helper.rb +39 -5
- data/spec/support/database.rb +10 -6
- data/temporal_tables.gemspec +31 -18
- metadata +103 -35
- data/.github/workflow/test.yml +0 -44
- data/gemfiles/Gemfile.5.1.mysql +0 -16
- data/gemfiles/Gemfile.5.1.mysql.lock +0 -147
- data/gemfiles/Gemfile.5.1.pg +0 -16
- data/gemfiles/Gemfile.5.1.pg.lock +0 -147
- data/gemfiles/Gemfile.5.2.mysql.lock +0 -155
- data/gemfiles/Gemfile.5.2.pg.lock +0 -155
- data/lib/temporal_tables/join_extensions.rb +0 -20
- data/spec/extensions/combustion.rb +0 -9
- data/spec/internal/config/routes.rb +0 -3
@@ -1,155 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
temporal_tables (0.8.1)
|
5
|
-
rails (>= 5.0, < 6.1)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actioncable (5.2.0)
|
11
|
-
actionpack (= 5.2.0)
|
12
|
-
nio4r (~> 2.0)
|
13
|
-
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailer (5.2.0)
|
15
|
-
actionpack (= 5.2.0)
|
16
|
-
actionview (= 5.2.0)
|
17
|
-
activejob (= 5.2.0)
|
18
|
-
mail (~> 2.5, >= 2.5.4)
|
19
|
-
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.2.0)
|
21
|
-
actionview (= 5.2.0)
|
22
|
-
activesupport (= 5.2.0)
|
23
|
-
rack (~> 2.0)
|
24
|
-
rack-test (>= 0.6.3)
|
25
|
-
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.2.0)
|
28
|
-
activesupport (= 5.2.0)
|
29
|
-
builder (~> 3.1)
|
30
|
-
erubi (~> 1.4)
|
31
|
-
rails-dom-testing (~> 2.0)
|
32
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.2.0)
|
34
|
-
activesupport (= 5.2.0)
|
35
|
-
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.2.0)
|
37
|
-
activesupport (= 5.2.0)
|
38
|
-
activerecord (5.2.0)
|
39
|
-
activemodel (= 5.2.0)
|
40
|
-
activesupport (= 5.2.0)
|
41
|
-
arel (>= 9.0)
|
42
|
-
activestorage (5.2.0)
|
43
|
-
actionpack (= 5.2.0)
|
44
|
-
activerecord (= 5.2.0)
|
45
|
-
marcel (~> 0.3.1)
|
46
|
-
activesupport (5.2.0)
|
47
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
-
i18n (>= 0.7, < 2)
|
49
|
-
minitest (~> 5.1)
|
50
|
-
tzinfo (~> 1.1)
|
51
|
-
arel (9.0.0)
|
52
|
-
builder (3.2.3)
|
53
|
-
byebug (10.0.2)
|
54
|
-
combustion (0.9.1)
|
55
|
-
activesupport (>= 3.0.0)
|
56
|
-
railties (>= 3.0.0)
|
57
|
-
thor (>= 0.14.6)
|
58
|
-
concurrent-ruby (1.0.5)
|
59
|
-
crass (1.0.4)
|
60
|
-
database_cleaner (1.7.0)
|
61
|
-
diff-lcs (1.3)
|
62
|
-
erubi (1.7.1)
|
63
|
-
gemika (0.3.2)
|
64
|
-
globalid (0.4.1)
|
65
|
-
activesupport (>= 4.2.0)
|
66
|
-
i18n (1.0.1)
|
67
|
-
concurrent-ruby (~> 1.0)
|
68
|
-
loofah (2.2.2)
|
69
|
-
crass (~> 1.0.2)
|
70
|
-
nokogiri (>= 1.5.9)
|
71
|
-
mail (2.7.0)
|
72
|
-
mini_mime (>= 0.1.1)
|
73
|
-
marcel (0.3.2)
|
74
|
-
mimemagic (~> 0.3.2)
|
75
|
-
method_source (0.9.0)
|
76
|
-
mimemagic (0.3.2)
|
77
|
-
mini_mime (1.0.0)
|
78
|
-
mini_portile2 (2.3.0)
|
79
|
-
minitest (5.11.3)
|
80
|
-
mysql2 (0.4.10)
|
81
|
-
nio4r (2.3.1)
|
82
|
-
nokogiri (1.8.4)
|
83
|
-
mini_portile2 (~> 2.3.0)
|
84
|
-
rack (2.0.5)
|
85
|
-
rack-test (1.0.0)
|
86
|
-
rack (>= 1.0, < 3)
|
87
|
-
rails (5.2.0)
|
88
|
-
actioncable (= 5.2.0)
|
89
|
-
actionmailer (= 5.2.0)
|
90
|
-
actionpack (= 5.2.0)
|
91
|
-
actionview (= 5.2.0)
|
92
|
-
activejob (= 5.2.0)
|
93
|
-
activemodel (= 5.2.0)
|
94
|
-
activerecord (= 5.2.0)
|
95
|
-
activestorage (= 5.2.0)
|
96
|
-
activesupport (= 5.2.0)
|
97
|
-
bundler (>= 1.3.0)
|
98
|
-
railties (= 5.2.0)
|
99
|
-
sprockets-rails (>= 2.0.0)
|
100
|
-
rails-dom-testing (2.0.3)
|
101
|
-
activesupport (>= 4.2.0)
|
102
|
-
nokogiri (>= 1.6)
|
103
|
-
rails-html-sanitizer (1.0.4)
|
104
|
-
loofah (~> 2.2, >= 2.2.2)
|
105
|
-
railties (5.2.0)
|
106
|
-
actionpack (= 5.2.0)
|
107
|
-
activesupport (= 5.2.0)
|
108
|
-
method_source
|
109
|
-
rake (>= 0.8.7)
|
110
|
-
thor (>= 0.18.1, < 2.0)
|
111
|
-
rake (12.3.1)
|
112
|
-
rspec (3.7.0)
|
113
|
-
rspec-core (~> 3.7.0)
|
114
|
-
rspec-expectations (~> 3.7.0)
|
115
|
-
rspec-mocks (~> 3.7.0)
|
116
|
-
rspec-core (3.7.1)
|
117
|
-
rspec-support (~> 3.7.0)
|
118
|
-
rspec-expectations (3.7.0)
|
119
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
120
|
-
rspec-support (~> 3.7.0)
|
121
|
-
rspec-mocks (3.7.0)
|
122
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
123
|
-
rspec-support (~> 3.7.0)
|
124
|
-
rspec-support (3.7.1)
|
125
|
-
sprockets (3.7.2)
|
126
|
-
concurrent-ruby (~> 1.0)
|
127
|
-
rack (> 1, < 3)
|
128
|
-
sprockets-rails (3.2.1)
|
129
|
-
actionpack (>= 4.0)
|
130
|
-
activesupport (>= 4.0)
|
131
|
-
sprockets (>= 3.0.0)
|
132
|
-
thor (0.20.0)
|
133
|
-
thread_safe (0.3.6)
|
134
|
-
tzinfo (1.2.5)
|
135
|
-
thread_safe (~> 0.1)
|
136
|
-
websocket-driver (0.7.0)
|
137
|
-
websocket-extensions (>= 0.1.0)
|
138
|
-
websocket-extensions (0.1.3)
|
139
|
-
|
140
|
-
PLATFORMS
|
141
|
-
ruby
|
142
|
-
|
143
|
-
DEPENDENCIES
|
144
|
-
byebug
|
145
|
-
combustion
|
146
|
-
database_cleaner
|
147
|
-
gemika
|
148
|
-
mysql2 (~> 0.4.4)
|
149
|
-
rails (~> 5.2.0)
|
150
|
-
rake
|
151
|
-
rspec (~> 3.4)
|
152
|
-
temporal_tables!
|
153
|
-
|
154
|
-
BUNDLED WITH
|
155
|
-
1.17.3
|
@@ -1,155 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
temporal_tables (0.8.1)
|
5
|
-
rails (>= 5.0, < 6.1)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actioncable (5.2.0)
|
11
|
-
actionpack (= 5.2.0)
|
12
|
-
nio4r (~> 2.0)
|
13
|
-
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailer (5.2.0)
|
15
|
-
actionpack (= 5.2.0)
|
16
|
-
actionview (= 5.2.0)
|
17
|
-
activejob (= 5.2.0)
|
18
|
-
mail (~> 2.5, >= 2.5.4)
|
19
|
-
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.2.0)
|
21
|
-
actionview (= 5.2.0)
|
22
|
-
activesupport (= 5.2.0)
|
23
|
-
rack (~> 2.0)
|
24
|
-
rack-test (>= 0.6.3)
|
25
|
-
rails-dom-testing (~> 2.0)
|
26
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.2.0)
|
28
|
-
activesupport (= 5.2.0)
|
29
|
-
builder (~> 3.1)
|
30
|
-
erubi (~> 1.4)
|
31
|
-
rails-dom-testing (~> 2.0)
|
32
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.2.0)
|
34
|
-
activesupport (= 5.2.0)
|
35
|
-
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.2.0)
|
37
|
-
activesupport (= 5.2.0)
|
38
|
-
activerecord (5.2.0)
|
39
|
-
activemodel (= 5.2.0)
|
40
|
-
activesupport (= 5.2.0)
|
41
|
-
arel (>= 9.0)
|
42
|
-
activestorage (5.2.0)
|
43
|
-
actionpack (= 5.2.0)
|
44
|
-
activerecord (= 5.2.0)
|
45
|
-
marcel (~> 0.3.1)
|
46
|
-
activesupport (5.2.0)
|
47
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
-
i18n (>= 0.7, < 2)
|
49
|
-
minitest (~> 5.1)
|
50
|
-
tzinfo (~> 1.1)
|
51
|
-
arel (9.0.0)
|
52
|
-
builder (3.2.3)
|
53
|
-
byebug (10.0.2)
|
54
|
-
combustion (0.9.1)
|
55
|
-
activesupport (>= 3.0.0)
|
56
|
-
railties (>= 3.0.0)
|
57
|
-
thor (>= 0.14.6)
|
58
|
-
concurrent-ruby (1.0.5)
|
59
|
-
crass (1.0.4)
|
60
|
-
database_cleaner (1.7.0)
|
61
|
-
diff-lcs (1.3)
|
62
|
-
erubi (1.7.1)
|
63
|
-
gemika (0.3.2)
|
64
|
-
globalid (0.4.1)
|
65
|
-
activesupport (>= 4.2.0)
|
66
|
-
i18n (1.0.1)
|
67
|
-
concurrent-ruby (~> 1.0)
|
68
|
-
loofah (2.2.2)
|
69
|
-
crass (~> 1.0.2)
|
70
|
-
nokogiri (>= 1.5.9)
|
71
|
-
mail (2.7.0)
|
72
|
-
mini_mime (>= 0.1.1)
|
73
|
-
marcel (0.3.2)
|
74
|
-
mimemagic (~> 0.3.2)
|
75
|
-
method_source (0.9.0)
|
76
|
-
mimemagic (0.3.2)
|
77
|
-
mini_mime (1.0.0)
|
78
|
-
mini_portile2 (2.3.0)
|
79
|
-
minitest (5.11.3)
|
80
|
-
nio4r (2.3.1)
|
81
|
-
nokogiri (1.8.4)
|
82
|
-
mini_portile2 (~> 2.3.0)
|
83
|
-
pg (1.0.0)
|
84
|
-
rack (2.0.5)
|
85
|
-
rack-test (1.0.0)
|
86
|
-
rack (>= 1.0, < 3)
|
87
|
-
rails (5.2.0)
|
88
|
-
actioncable (= 5.2.0)
|
89
|
-
actionmailer (= 5.2.0)
|
90
|
-
actionpack (= 5.2.0)
|
91
|
-
actionview (= 5.2.0)
|
92
|
-
activejob (= 5.2.0)
|
93
|
-
activemodel (= 5.2.0)
|
94
|
-
activerecord (= 5.2.0)
|
95
|
-
activestorage (= 5.2.0)
|
96
|
-
activesupport (= 5.2.0)
|
97
|
-
bundler (>= 1.3.0)
|
98
|
-
railties (= 5.2.0)
|
99
|
-
sprockets-rails (>= 2.0.0)
|
100
|
-
rails-dom-testing (2.0.3)
|
101
|
-
activesupport (>= 4.2.0)
|
102
|
-
nokogiri (>= 1.6)
|
103
|
-
rails-html-sanitizer (1.0.4)
|
104
|
-
loofah (~> 2.2, >= 2.2.2)
|
105
|
-
railties (5.2.0)
|
106
|
-
actionpack (= 5.2.0)
|
107
|
-
activesupport (= 5.2.0)
|
108
|
-
method_source
|
109
|
-
rake (>= 0.8.7)
|
110
|
-
thor (>= 0.18.1, < 2.0)
|
111
|
-
rake (12.3.1)
|
112
|
-
rspec (3.7.0)
|
113
|
-
rspec-core (~> 3.7.0)
|
114
|
-
rspec-expectations (~> 3.7.0)
|
115
|
-
rspec-mocks (~> 3.7.0)
|
116
|
-
rspec-core (3.7.1)
|
117
|
-
rspec-support (~> 3.7.0)
|
118
|
-
rspec-expectations (3.7.0)
|
119
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
120
|
-
rspec-support (~> 3.7.0)
|
121
|
-
rspec-mocks (3.7.0)
|
122
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
123
|
-
rspec-support (~> 3.7.0)
|
124
|
-
rspec-support (3.7.1)
|
125
|
-
sprockets (3.7.2)
|
126
|
-
concurrent-ruby (~> 1.0)
|
127
|
-
rack (> 1, < 3)
|
128
|
-
sprockets-rails (3.2.1)
|
129
|
-
actionpack (>= 4.0)
|
130
|
-
activesupport (>= 4.0)
|
131
|
-
sprockets (>= 3.0.0)
|
132
|
-
thor (0.20.0)
|
133
|
-
thread_safe (0.3.6)
|
134
|
-
tzinfo (1.2.5)
|
135
|
-
thread_safe (~> 0.1)
|
136
|
-
websocket-driver (0.7.0)
|
137
|
-
websocket-extensions (>= 0.1.0)
|
138
|
-
websocket-extensions (0.1.3)
|
139
|
-
|
140
|
-
PLATFORMS
|
141
|
-
ruby
|
142
|
-
|
143
|
-
DEPENDENCIES
|
144
|
-
byebug
|
145
|
-
combustion
|
146
|
-
database_cleaner
|
147
|
-
gemika
|
148
|
-
pg (>= 0.18, < 2.0)
|
149
|
-
rails (~> 5.2.0)
|
150
|
-
rake
|
151
|
-
rspec (~> 3.4)
|
152
|
-
temporal_tables!
|
153
|
-
|
154
|
-
BUNDLED WITH
|
155
|
-
1.17.3
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module TemporalTables
|
2
|
-
# This is required for eager_load to work in Rails 5.0.x
|
3
|
-
module JoinDependencyExtensions
|
4
|
-
def build_constraint(klass, table, key, foreign_table, foreign_key)
|
5
|
-
constraint = super
|
6
|
-
if at_value = Thread.current[:at_time]
|
7
|
-
constraint = constraint.and(klass.build_temporal_constraint(at_value))
|
8
|
-
end
|
9
|
-
constraint
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
case Rails::VERSION::MAJOR
|
15
|
-
when 5
|
16
|
-
case Rails::VERSION::MINOR
|
17
|
-
when 0, 1
|
18
|
-
ActiveRecord::Associations::JoinDependency::JoinAssociation.prepend TemporalTables::JoinDependencyExtensions
|
19
|
-
end
|
20
|
-
end
|