activerecord-bitemporal 5.1.0 → 5.2.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/.circleci/config.yml +0 -1
- data/Appraisals +0 -4
- data/CHANGELOG.md +19 -0
- data/lib/activerecord-bitemporal/scope.rb +16 -0
- data/lib/activerecord-bitemporal/version.rb +1 -1
- data/lib/activerecord-bitemporal.rb +2 -1
- metadata +2 -3
- data/gemfiles/rails_main.gemfile +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 690af251479740f03e0dafd504a9b906672e8860c6f8734b37b24f0d2c0c2b5d
|
4
|
+
data.tar.gz: 2b41e3d362d267e4b573911ec75a1b03de9c4259bf8312c6fae9759aae29bf34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86c42c61e77843ef9a76e45868d71722f08e8af28f6c1747f2d4ea55ecd1bf5d5731d3e4b41ad82827c59e0f8e21f3b9ab714a7dc2a442c387c17c97858c8bc
|
7
|
+
data.tar.gz: e53538e79ab1b48563e804080a23f8e8aa6f67f6fa71a54880fa7c93696a9e8778fc5248937ea653cefe72f8cb215e84aec223559f1436506354f65ade735f8d
|
data/.circleci/config.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.2.0
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
### Deprecated
|
10
|
+
|
11
|
+
### Removed
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
|
15
|
+
- [Delegate CollectionProxy#bitemporal_value to Relation #168](https://github.com/kufu/activerecord-bitemporal/pull/168)
|
16
|
+
- [Fix unintended valid_datetime set when `CollectionProxy#load` #169](https://github.com/kufu/activerecord-bitemporal/pull/169)
|
17
|
+
|
18
|
+
### Chores
|
19
|
+
|
20
|
+
- [Do not run CI against rails_main #166](https://github.com/kufu/activerecord-bitemporal/pull/166)
|
21
|
+
|
3
22
|
## 5.1.0
|
4
23
|
|
5
24
|
### Added
|
@@ -141,6 +141,22 @@ module ActiveRecord::Bitemporal
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
+
module CollectionProxy
|
145
|
+
# Delegate to ActiveRecord::Bitemporal::Relation
|
146
|
+
# @see https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/associations/collection_proxy.rb#L1115-L1124
|
147
|
+
#
|
148
|
+
# In order to update the CollectionProxy state, `load` needs to be excluded.
|
149
|
+
# The reason for using `@association` instead of delegating this method is to preserve state such as `loaded`.
|
150
|
+
# @see https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/associations/collection_proxy.rb#L44
|
151
|
+
#
|
152
|
+
# There is no need to delegate to `scope` as `ActiveRecord::Bitemporal::Relation::Finder`'s methods are delegated
|
153
|
+
# by `ActiveRecord::Delegation`. This is not a problem because `scoping` used in this is delegated to `scope`.
|
154
|
+
# @see https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/relation/delegation.rb#L117
|
155
|
+
delegate :bitemporal_value, :bitemporal_value=, :valid_datetime, :valid_date,
|
156
|
+
:transaction_datetime, :bitemporal_option, :bitemporal_option_merge!,
|
157
|
+
:build_arel, :primary_key, to: :scope
|
158
|
+
end
|
159
|
+
|
144
160
|
module Scope
|
145
161
|
extend ActiveSupport::Concern
|
146
162
|
|
@@ -29,7 +29,6 @@ module ActiveRecord::Bitemporal::Bitemporalize
|
|
29
29
|
def prepend_relation_delegate_class(mod)
|
30
30
|
relation_delegate_class(ActiveRecord::Relation).prepend mod
|
31
31
|
relation_delegate_class(ActiveRecord::AssociationRelation).prepend mod
|
32
|
-
relation_delegate_class(ActiveRecord::Associations::CollectionProxy).prepend mod
|
33
32
|
end
|
34
33
|
end
|
35
34
|
end
|
@@ -58,6 +57,7 @@ module ActiveRecord::Bitemporal::Bitemporalize
|
|
58
57
|
def inherited(klass)
|
59
58
|
super
|
60
59
|
klass.prepend_relation_delegate_class ActiveRecord::Bitemporal::Relation
|
60
|
+
klass.relation_delegate_class(ActiveRecord::Associations::CollectionProxy).prepend ActiveRecord::Bitemporal::CollectionProxy
|
61
61
|
if relation_delegate_class(ActiveRecord::Relation).ancestors.include? ActiveRecord::Bitemporal::Relation::MergeWithExceptBitemporalDefaultScope
|
62
62
|
klass.relation_delegate_class(ActiveRecord::Relation).prepend ActiveRecord::Bitemporal::Relation::MergeWithExceptBitemporalDefaultScope
|
63
63
|
end
|
@@ -169,6 +169,7 @@ module ActiveRecord::Bitemporal::Bitemporalize
|
|
169
169
|
validates bitemporal_id_key, uniqueness: true, allow_nil: true, strict: enable_strict_by_validates_bitemporal_id
|
170
170
|
|
171
171
|
prepend_relation_delegate_class ActiveRecord::Bitemporal::Relation
|
172
|
+
relation_delegate_class(ActiveRecord::Associations::CollectionProxy).prepend ActiveRecord::Bitemporal::CollectionProxy
|
172
173
|
end
|
173
174
|
end
|
174
175
|
|
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.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SmartHR
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -148,7 +148,6 @@ files:
|
|
148
148
|
- gemfiles/rails_6.1.gemfile
|
149
149
|
- gemfiles/rails_7.0.gemfile
|
150
150
|
- gemfiles/rails_7.1.gemfile
|
151
|
-
- gemfiles/rails_main.gemfile
|
152
151
|
- lib/activerecord-bitemporal.rb
|
153
152
|
- lib/activerecord-bitemporal/bitemporal.rb
|
154
153
|
- lib/activerecord-bitemporal/callbacks.rb
|