historiographer 3.1.2 → 4.0.0
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/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/historiographer.gemspec +4 -4
- data/lib/historiographer/history_migration.rb +7 -2
- data/lib/historiographer.rb +7 -2
- data/spec/examples.txt +30 -27
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f16398b9f6b0a3d58501a2115eabca0e0f93a938d04eeb4c21d3713f9b70079a
|
4
|
+
data.tar.gz: a460ef65372e236b001225b1028837eb7ba107e8d45d958c39d003be0cd64db4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b545edcfe0076f0e83f5478347a9298fce77118d7274ad39ce8304844637b7ee15980e66c02dff36321eda4e36b0defdb10b6c33cc7486fba47e780043e5f42
|
7
|
+
data.tar.gz: f828cf26cc357fb0b3e2750bfcc1f62dc628c1579f1fa3356062f34314545783bb6ecb80366e4ac9d6988eae8374168afeb0d29c166daa9dbd7c860074494de4
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
4.0.0
|
data/historiographer.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: historiographer
|
5
|
+
# stub: historiographer 4.0.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "historiographer".freeze
|
9
|
-
s.version = "
|
9
|
+
s.version = "4.0.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["brettshollenberger".freeze]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2023-08-22"
|
15
15
|
s.description = "Creates separate tables for each history table".freeze
|
16
16
|
s.email = "brett.shollenberger@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -62,7 +62,7 @@ Gem::Specification.new do |s|
|
|
62
62
|
]
|
63
63
|
s.homepage = "http://github.com/brettshollenberger/historiographer".freeze
|
64
64
|
s.licenses = ["MIT".freeze]
|
65
|
-
s.rubygems_version = "3.2.
|
65
|
+
s.rubygems_version = "3.2.22".freeze
|
66
66
|
s.summary = "Create histories of your ActiveRecord tables".freeze
|
67
67
|
|
68
68
|
if s.respond_to? :specification_version then
|
@@ -34,7 +34,12 @@ module Historiographer
|
|
34
34
|
opts = {}
|
35
35
|
opts.merge!(column.as_json.clone)
|
36
36
|
|
37
|
-
|
37
|
+
if RUBY_VERSION.to_i >= 3
|
38
|
+
puts "Hello"
|
39
|
+
send(column.type, column.name, **opts.symbolize_keys!)
|
40
|
+
else
|
41
|
+
send(column.type, column.name, opts.symbolize_keys!)
|
42
|
+
end
|
38
43
|
end
|
39
44
|
|
40
45
|
datetime :history_started_at, null: false
|
@@ -86,4 +91,4 @@ module Historiographer
|
|
86
91
|
|
87
92
|
end
|
88
93
|
end
|
89
|
-
end
|
94
|
+
end
|
data/lib/historiographer.rb
CHANGED
@@ -174,8 +174,13 @@ module Historiographer
|
|
174
174
|
else
|
175
175
|
opts = { class_name: class_name }
|
176
176
|
opts[:foreign_key] = klass.history_foreign_key if klass.respond_to?(:history_foreign_key)
|
177
|
-
|
178
|
-
|
177
|
+
if RUBY_VERSION.to_i >= 3
|
178
|
+
has_many :histories, **opts
|
179
|
+
has_one :current_history, -> { current }, **opts
|
180
|
+
else
|
181
|
+
has_many :histories, opts
|
182
|
+
has_one :current_history, -> { current }, opts
|
183
|
+
end
|
179
184
|
end
|
180
185
|
|
181
186
|
klass.send(:include, Historiographer::History) unless klass.ancestors.include?(Historiographer::History)
|
data/spec/examples.txt
CHANGED
@@ -1,29 +1,32 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
----------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/historiographer_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/historiographer_spec.rb[1:1:2] | passed | 0.
|
5
|
-
./spec/historiographer_spec.rb[1:1:3] | passed | 0.
|
6
|
-
./spec/historiographer_spec.rb[1:2:1] | passed | 0.
|
7
|
-
./spec/historiographer_spec.rb[1:2:2] | passed | 0.
|
8
|
-
./spec/historiographer_spec.rb[1:2:3:1:1] | passed | 0.
|
9
|
-
./spec/historiographer_spec.rb[1:2:3:1:2] | passed | 0.
|
10
|
-
./spec/historiographer_spec.rb[1:2:3:2:1] | passed | 0.
|
11
|
-
./spec/historiographer_spec.rb[1:2:3:2:2] | passed | 0.
|
12
|
-
./spec/historiographer_spec.rb[1:2:3:2:3] | passed | 0.
|
13
|
-
./spec/historiographer_spec.rb[1:2:3:3:1] | passed | 0.
|
14
|
-
./spec/historiographer_spec.rb[1:2:3:3:2] | passed | 0.
|
15
|
-
./spec/historiographer_spec.rb[1:2:4:1] | passed | 0.
|
16
|
-
./spec/historiographer_spec.rb[1:2:4:2] | passed | 0.
|
17
|
-
./spec/historiographer_spec.rb[1:2:4:3] | passed | 0.
|
18
|
-
./spec/historiographer_spec.rb[1:2:5]
|
19
|
-
./spec/historiographer_spec.rb[1:2:
|
20
|
-
./spec/historiographer_spec.rb[1:2:
|
21
|
-
./spec/historiographer_spec.rb[1:
|
22
|
-
./spec/historiographer_spec.rb[1:
|
23
|
-
./spec/historiographer_spec.rb[1:
|
24
|
-
./spec/historiographer_spec.rb[1:
|
25
|
-
./spec/historiographer_spec.rb[1:
|
26
|
-
./spec/historiographer_spec.rb[1:
|
27
|
-
./spec/historiographer_spec.rb[1:
|
28
|
-
./spec/historiographer_spec.rb[1:
|
29
|
-
./spec/historiographer_spec.rb[1:
|
3
|
+
./spec/historiographer_spec.rb[1:1:1] | passed | 0.05541 seconds |
|
4
|
+
./spec/historiographer_spec.rb[1:1:2] | passed | 0.04942 seconds |
|
5
|
+
./spec/historiographer_spec.rb[1:1:3] | passed | 0.02648 seconds |
|
6
|
+
./spec/historiographer_spec.rb[1:2:1] | passed | 0.03832 seconds |
|
7
|
+
./spec/historiographer_spec.rb[1:2:2] | passed | 0.00076 seconds |
|
8
|
+
./spec/historiographer_spec.rb[1:2:3:1:1] | passed | 0.04672 seconds |
|
9
|
+
./spec/historiographer_spec.rb[1:2:3:1:2] | passed | 0.01971 seconds |
|
10
|
+
./spec/historiographer_spec.rb[1:2:3:2:1] | passed | 0.12226 seconds |
|
11
|
+
./spec/historiographer_spec.rb[1:2:3:2:2] | passed | 0.09424 seconds |
|
12
|
+
./spec/historiographer_spec.rb[1:2:3:2:3] | passed | 0.05644 seconds |
|
13
|
+
./spec/historiographer_spec.rb[1:2:3:3:1] | passed | 0.16536 seconds |
|
14
|
+
./spec/historiographer_spec.rb[1:2:3:3:2] | passed | 0.01638 seconds |
|
15
|
+
./spec/historiographer_spec.rb[1:2:4:1] | passed | 0.00552 seconds |
|
16
|
+
./spec/historiographer_spec.rb[1:2:4:2] | passed | 0.01095 seconds |
|
17
|
+
./spec/historiographer_spec.rb[1:2:4:3] | passed | 0.0022 seconds |
|
18
|
+
./spec/historiographer_spec.rb[1:2:5:1] | passed | 0.08367 seconds |
|
19
|
+
./spec/historiographer_spec.rb[1:2:5:2] | passed | 0.10781 seconds |
|
20
|
+
./spec/historiographer_spec.rb[1:2:5:3] | passed | 0.00516 seconds |
|
21
|
+
./spec/historiographer_spec.rb[1:2:6] | passed | 0.00482 seconds |
|
22
|
+
./spec/historiographer_spec.rb[1:2:7] | passed | 0.00642 seconds |
|
23
|
+
./spec/historiographer_spec.rb[1:2:8] | passed | 0.00926 seconds |
|
24
|
+
./spec/historiographer_spec.rb[1:3:1] | passed | 0.01607 seconds |
|
25
|
+
./spec/historiographer_spec.rb[1:4:1] | passed | 0.03777 seconds |
|
26
|
+
./spec/historiographer_spec.rb[1:5:1] | passed | 0.04254 seconds |
|
27
|
+
./spec/historiographer_spec.rb[1:5:2] | passed | 0.02652 seconds |
|
28
|
+
./spec/historiographer_spec.rb[1:6:1] | passed | 0.23851 seconds |
|
29
|
+
./spec/historiographer_spec.rb[1:6:2] | passed | 0.16412 seconds |
|
30
|
+
./spec/historiographer_spec.rb[1:7:1] | passed | 0.07495 seconds |
|
31
|
+
./spec/historiographer_spec.rb[1:8:1] | passed | 0.02917 seconds |
|
32
|
+
./spec/historiographer_spec.rb[1:9:1] | passed | 0.0228 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: historiographer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- brettshollenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
- !ruby/object:Gem::Version
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
|
-
rubygems_version: 3.2.
|
290
|
+
rubygems_version: 3.2.22
|
291
291
|
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: Create histories of your ActiveRecord tables
|