activerecord-bitemporal 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/activerecord-bitemporal/patches.rb +12 -0
- data/lib/activerecord-bitemporal/version.rb +1 -1
- data/lib/activerecord-bitemporal/visualizer.rb +11 -2
- 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: '09a592f0b1e43e737bd1fdbc8a88f025af734bf3c0d42c4fa2297dbaa72a68e5'
|
4
|
+
data.tar.gz: b591ee586a0d5fc3f109444787f86bc5c399f22d33c44d84d80bde6f91b141ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d9d4f5dd752200b2e803bca72b123ed067165bd61092755fb091b10eb35fd58b82617f7957d48f738b8f9ec09c480d8338553c3b33098202056d2d20e94d09
|
7
|
+
data.tar.gz: d90e6bbb55b783bc75f650c00c4bbaf226b4d5ba67c86e004bfecbe75224031c0a0ad69c95955741c0b560bdc85fc2a4f3945d07885d0b128ecbf0416f003569
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.1.0
|
4
|
+
|
5
|
+
### Added
|
6
|
+
- [add label option #127](https://github.com/kufu/activerecord-bitemporal/pull/127)
|
7
|
+
|
8
|
+
### Changed
|
9
|
+
- [Support for inverse_of of Rails 6.1 or higher #130](https://github.com/kufu/activerecord-bitemporal/pull/130)
|
10
|
+
|
11
|
+
### Deprecated
|
12
|
+
|
13
|
+
### Removed
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
|
3
17
|
## 4.0.0
|
4
18
|
|
5
19
|
### Breaking Changed
|
@@ -79,6 +79,18 @@ module ActiveRecord::Bitemporal
|
|
79
79
|
def bi_temporal_model?
|
80
80
|
owner.class.bi_temporal_model? && klass&.bi_temporal_model?
|
81
81
|
end
|
82
|
+
|
83
|
+
def matches_foreign_key?(record)
|
84
|
+
return super unless owner.class.bi_temporal_model?
|
85
|
+
|
86
|
+
begin
|
87
|
+
original_owner_id = owner.id
|
88
|
+
owner.id = owner.read_attribute(owner.class.bitemporal_id_key)
|
89
|
+
super
|
90
|
+
ensure
|
91
|
+
owner.id = original_owner_id
|
92
|
+
end
|
93
|
+
end
|
82
94
|
end
|
83
95
|
|
84
96
|
module ThroughAssociation
|
@@ -91,8 +91,17 @@ module ActiveRecord::Bitemporal
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
94
|
-
|
95
|
-
|
94
|
+
|
95
|
+
transaction_label = 'transaction_datetime'
|
96
|
+
right_margin = time_length + 1 - transaction_label.size
|
97
|
+
|
98
|
+
label = if right_margin >= 0
|
99
|
+
"#{transaction_label + ' ' * right_margin}| valid_datetime"
|
100
|
+
else
|
101
|
+
"#{transaction_label[0...right_margin]}| valid_datetime"
|
102
|
+
end
|
103
|
+
|
104
|
+
"#{label}\n#{headers.to_s}\n#{body.to_s}"
|
96
105
|
end
|
97
106
|
|
98
107
|
# Compute a dictionary of where each time should be plotted.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-bitemporal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SmartHR
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
192
|
+
rubygems_version: 3.3.26
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: BiTemporal Data Model for ActiveRecord
|