activerecord-bitemporal 5.0.0 → 5.0.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0e6cafe3d918cd4bdf47c2610eaf3760cfcedbec0365a7675ef99790a05baaf
|
4
|
+
data.tar.gz: 79b7823949b22cbcacdfb75b561c70808135ebd3dc1c6a5ff0ef8152c75b8d79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4331c2b17a26dfea76b5c1c85a6a0feac925a1c0b7d634fa734e35e5f7732e0d49d04172ae4bf6af5ae62b213481bd09da7807312f241578e72f2a9ee952f640
|
7
|
+
data.tar.gz: 98ffa072e196a6af9b61ef01ee5e7d8e3ef83a94abd8f666738831783b35bb16551fd0bd1d561f76a6a55aa522d4609274ec3e6a6a78d311b7c76e53c860b1c4
|
data/.github/auto_assign.yml
CHANGED
@@ -6,15 +6,10 @@ addAssignees: false
|
|
6
6
|
|
7
7
|
# A list of reviewers to be added to pull requests (GitHub user name)
|
8
8
|
reviewers:
|
9
|
-
- Dooor
|
10
|
-
- QWYNG
|
11
|
-
- bonobono555
|
12
9
|
- krororo
|
13
10
|
- lighty
|
14
11
|
- mkmn
|
15
|
-
- motsat
|
16
12
|
- osyo-manga
|
17
|
-
- wakasa51
|
18
13
|
- wata727
|
19
14
|
- yono
|
20
15
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.0.1
|
4
|
+
|
5
|
+
- [Fix a typo #157](https://github.com/kufu/activerecord-bitemporal/pull/157)
|
6
|
+
- [Remove unneeded unscope values #159](https://github.com/kufu/activerecord-bitemporal/pull/159)
|
7
|
+
- [Remove unused `without_ignore` option #160](https://github.com/kufu/activerecord-bitemporal/pull/160)
|
8
|
+
- [update auto assign #161](https://github.com/kufu/activerecord-bitemporal/pull/161)
|
9
|
+
|
3
10
|
## 5.0.0
|
4
11
|
|
5
12
|
### Breaking Changed
|
@@ -577,7 +577,7 @@ module ActiveRecord
|
|
577
577
|
target_datetime
|
578
578
|
# NOTE: 新規作成時以外では target_datetime の値を基準としてバリデーションする
|
579
579
|
# 更新時にバリデーションする場合、valid_from の時間ではなくて target_datetime の時間を基準としているため
|
580
|
-
#
|
580
|
+
# valid_from を基準としてしまうと整合性が取れなくなってしまう
|
581
581
|
elsif !record.new_record?
|
582
582
|
target_datetime
|
583
583
|
else
|
@@ -259,7 +259,7 @@ module ActiveRecord::Bitemporal
|
|
259
259
|
:gteq # column >= datetime
|
260
260
|
].each { |op|
|
261
261
|
module_eval <<-STR, __FILE__, __LINE__ + 1
|
262
|
-
def _#{column}_#{op}(datetime
|
262
|
+
def _#{column}_#{op}(datetime)
|
263
263
|
target_datetime = datetime&.in_time_zone || Time.current
|
264
264
|
bitemporal_rewhere_bind("#{column}", :#{op}, target_datetime)
|
265
265
|
.tap { |relation| break relation.bitemporal_rewhere_bind("#{column}", :#{op}, target_datetime, bitemporal_value[:through].arel_table) if bitemporal_value[:through] }
|
@@ -355,14 +355,9 @@ module ActiveRecord::Bitemporal
|
|
355
355
|
relation.bitemporal_value[:with_transaction_datetime] = :default_scope
|
356
356
|
end
|
357
357
|
|
358
|
-
# Calling scope was slow, so don't call scope
|
359
|
-
relation.unscope_values += [
|
360
|
-
{ where: "#{table.name}.transaction_from" },
|
361
|
-
{ where: "#{table.name}.transaction_to" }
|
362
|
-
]
|
363
358
|
relation = relation
|
364
|
-
._transaction_from_lteq(transaction_datetime || datetime
|
365
|
-
._transaction_to_gt(transaction_datetime || datetime
|
359
|
+
._transaction_from_lteq(transaction_datetime || datetime)
|
360
|
+
._transaction_to_gt(transaction_datetime || datetime)
|
366
361
|
else
|
367
362
|
relation.tap { |relation| relation.without_transaction_datetime unless ActiveRecord::Bitemporal.transaction_datetime }
|
368
363
|
end
|
@@ -375,13 +370,9 @@ module ActiveRecord::Bitemporal
|
|
375
370
|
relation.bitemporal_value[:with_valid_datetime] = :default_scope
|
376
371
|
end
|
377
372
|
|
378
|
-
relation.unscope_values += [
|
379
|
-
{ where: "#{table.name}.valid_from" },
|
380
|
-
{ where: "#{table.name}.valid_to" }
|
381
|
-
]
|
382
373
|
relation = relation
|
383
|
-
._valid_from_lteq(valid_datetime || datetime
|
384
|
-
._valid_to_gt(valid_datetime || datetime
|
374
|
+
._valid_from_lteq(valid_datetime || datetime)
|
375
|
+
._valid_to_gt(valid_datetime || datetime)
|
385
376
|
else
|
386
377
|
relation.tap { |relation| relation.without_valid_datetime unless ActiveRecord::Bitemporal.valid_datetime }
|
387
378
|
end
|
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: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SmartHR
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
rubygems_version: 3.3.
|
193
|
+
rubygems_version: 3.3.27
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: BiTemporal Data Model for ActiveRecord
|