activerecord-bitemporal 7.0.1 → 7.0.2

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: 553dc55266366a109d0f4275ed0e70229984d1fb139b858be2828c2d75e0c182
4
- data.tar.gz: dccb0a53b560b6c3a8eebd29e46e30b816c15002eddfbf0cbf6355838167fd76
3
+ metadata.gz: d9808dd4b2762d30fff3034bdfb311d3a01980806785d68cff6b9552d7bd2925
4
+ data.tar.gz: 9e7031bd39bd9e0841b029ec0540a77b06d2f6bcc54b2e6c992155191e06c326
5
5
  SHA512:
6
- metadata.gz: fcb1d50c24df2103608ff407207145b84a87649f862db1625343ce0f5281dde85f5c2a43af10ab5b72b6b2f118ace4705137a28a774ed159c7472bde4b1b091b
7
- data.tar.gz: 93fb11c615891a252b597678c4c53049460c093e80003f657e17a9c7ef2149592fd0ae91bc51f80da7619074e3de62f32e6207a7cbd281d48ea44ac23f6646b7
6
+ metadata.gz: 961e34ee22fce1303baed4c54822e33f43f49c6203108d6d03c562fed2baf3e1cede22fc6d5c0e7994cb538c9fa26d949356b31440f96dfb10459651d3211819
7
+ data.tar.gz: 73315ea3d3bdc29541cfdadb65b1530f1d2d1036704c5f110a2cedf7da7d7349cb2690b33dfeb5411437fb360be7aea13111765430d3f66e47dd078f376c5672
data/CHANGELOG.md CHANGED
@@ -16,6 +16,37 @@
16
16
 
17
17
  ### Chores
18
18
 
19
+ ## 7.0.2
20
+
21
+ ### Breaking Changes
22
+
23
+ ### Added
24
+
25
+ ### Changed
26
+
27
+ ### Deprecated
28
+
29
+ ### Removed
30
+
31
+ ### Fixed
32
+
33
+ - [Fix Relation#load to return self instead of an Array #267](https://github.com/kufu/activerecord-bitemporal/pull/267)
34
+
35
+ ### Chores
36
+
37
+ - [Bump actions/checkout from 6.0.3 to 7.0.0 #266](https://github.com/kufu/activerecord-bitemporal/pull/266)
38
+ - [Bump ruby/setup-ruby from 1.313.0 to 1.314.0 #265](https://github.com/kufu/activerecord-bitemporal/pull/265)
39
+ - [Bump rubygems/release-gem from 1.3.0 to 1.4.0 #264](https://github.com/kufu/activerecord-bitemporal/pull/264)
40
+ - [Bump ruby/setup-ruby from 1.310.0 to 1.313.0 #263](https://github.com/kufu/activerecord-bitemporal/pull/263)
41
+ - [Bump rubygems/release-gem from 1.2.0 to 1.3.0 #262](https://github.com/kufu/activerecord-bitemporal/pull/262)
42
+ - [Bump actions/checkout from 6.0.2 to 6.0.3 #261](https://github.com/kufu/activerecord-bitemporal/pull/261)
43
+ - [Bump ruby/setup-ruby from 1.308.0 to 1.310.0 #260](https://github.com/kufu/activerecord-bitemporal/pull/260)
44
+ - [Bump ruby/setup-ruby from 1.306.0 to 1.308.0 #259](https://github.com/kufu/activerecord-bitemporal/pull/259)
45
+ - [Increase Dependabot cooldown to 7 days #258](https://github.com/kufu/activerecord-bitemporal/pull/258)
46
+ - [Bump ruby/setup-ruby from 1.305.0 to 1.306.0 #257](https://github.com/kufu/activerecord-bitemporal/pull/257)
47
+ - [Bump ruby/setup-ruby from 1.302.0 to 1.305.0 #256](https://github.com/kufu/activerecord-bitemporal/pull/256)
48
+ - [Bump ruby/setup-ruby from 1.301.0 to 1.302.0 #255](https://github.com/kufu/activerecord-bitemporal/pull/255)
49
+
19
50
  ## 7.0.1
20
51
 
21
52
  ### Breaking Changes
@@ -294,9 +325,11 @@
294
325
  ## 4.1.0
295
326
 
296
327
  ### Added
328
+
297
329
  - [add label option #127](https://github.com/kufu/activerecord-bitemporal/pull/127)
298
330
 
299
331
  ### Changed
332
+
300
333
  - [Support for inverse_of of Rails 6.1 or higher #130](https://github.com/kufu/activerecord-bitemporal/pull/130)
301
334
 
302
335
  ### Deprecated
@@ -320,13 +353,13 @@
320
353
  ```rb
321
354
  class Employee < ActiveRecord::Base
322
355
  include ActiveRecord::Bitemporal
323
-
356
+
324
357
  after_bitemporal_create :log_create
325
358
  after_bitemporal_update :log_update
326
359
  after_bitemporal_destroy :log_destroy
327
-
360
+
328
361
  private
329
-
362
+
330
363
  def log_create
331
364
  puts "employee created"
332
365
  end
@@ -339,7 +372,7 @@
339
372
  puts "employee destroyed"
340
373
  end
341
374
  end
342
-
375
+
343
376
  employee = Employee.create!(...) # => "employee created"
344
377
  employee.update!(...) # => "employee updated"
345
378
  employee.destroy! # => "employee destroyed"
@@ -359,10 +392,10 @@
359
392
 
360
393
  ### Fixed
361
394
 
362
-
363
395
  ## 3.0.0
364
396
 
365
397
  ### Breaking Changes
398
+
366
399
  - [Assign updated bitemporal times to the receiver after update/destroy](https://github.com/kufu/activerecord-bitemporal/pull/118)
367
400
 
368
401
  ### Added
@@ -380,6 +413,7 @@
380
413
  ### Breaking Changes
381
414
 
382
415
  ### Added
416
+
383
417
  - [Add `InstanceMethods#swapped_id_previously_was`](https://github.com/kufu/activerecord-bitemporal/pull/114)
384
418
 
385
419
  ### Changed
@@ -395,6 +429,7 @@
395
429
  ### Breaking Changes
396
430
 
397
431
  ### Added
432
+
398
433
  - [replace postgres docker image](https://github.com/kufu/activerecord-bitemporal/pull/103)
399
434
  - [use Matrix Jobs in CircleCI](https://github.com/kufu/activerecord-bitemporal/pull/107)
400
435
  - [Add support changing swapped_id, when called #destroy](https://github.com/kufu/activerecord-bitemporal/pull/110)
@@ -412,6 +447,7 @@
412
447
  ### Breaking Changes
413
448
 
414
449
  ### Added
450
+
415
451
  - [Update valid_to after #update](https://github.com/kufu/activerecord-bitemporal/pull/105)
416
452
  - [Add GitHub Actions workflow to release to RubyGems.org](https://github.com/kufu/activerecord-bitemporal/pull/104)
417
453
  - [migrate Scheduled workflows in CircleCI](https://github.com/kufu/activerecord-bitemporal/pull/106)
@@ -427,11 +463,13 @@
427
463
  ## 2.0.0
428
464
 
429
465
  ### Breaking Changes
466
+
430
467
  - [[Proposal] Changed valid_in to exclude valid_from = to and valid_to = from. by osyo-manga · Pull Request #95](https://github.com/kufu/activerecord-bitemporal/pull/95)
431
468
 
432
469
  ### Added
433
470
 
434
471
  ### Changed
472
+
435
473
  - [[Proposal] Add range argument to .valid_allin. by Dooor · Pull Request #98](https://github.com/kufu/activerecord-bitemporal/pull/98)
436
474
 
437
475
  ### Deprecated
@@ -439,6 +477,7 @@
439
477
  ### Removed
440
478
 
441
479
  ### Fixed
480
+
442
481
  - [Fix JOIN query does not have valid_from / valid_to when using .or. by osyo-manga · Pull Request #99](https://github.com/kufu/activerecord-bitemporal/pull/99)
443
482
  - [Fix typo in README.md by Naoya9922 · Pull Request #101](https://github.com/kufu/activerecord-bitemporal/pull/101)
444
483
 
@@ -184,9 +184,9 @@ module ActiveRecord
184
184
  return super if loaded?
185
185
 
186
186
  # このタイミングで先読みしているアソシエーションが読み込まれるので時間を固定
187
- records = ActiveRecord::Bitemporal.with_bitemporal_option(**bitemporal_option) { super }
187
+ relation = ActiveRecord::Bitemporal.with_bitemporal_option(**bitemporal_option) { super }
188
188
 
189
- return records if records.empty?
189
+ return relation if relation.empty?
190
190
 
191
191
  valid_datetime_ = valid_datetime
192
192
  if ActiveRecord::Bitemporal.valid_datetime.nil? && (bitemporal_value[:with_valid_datetime].nil? || bitemporal_value[:with_valid_datetime] == :default_scope || valid_datetime_.nil?)
@@ -198,12 +198,14 @@ module ActiveRecord
198
198
  transaction_datetime_ = nil
199
199
  end
200
200
 
201
- return records if valid_datetime_.nil? && transaction_datetime_.nil?
201
+ return relation if valid_datetime_.nil? && transaction_datetime_.nil?
202
202
 
203
- records.each do |record|
203
+ relation.each do |record|
204
204
  record.send(:bitemporal_option_storage)[:valid_datetime] = valid_datetime_ if valid_datetime_
205
205
  record.send(:bitemporal_option_storage)[:transaction_datetime] = transaction_datetime_ if transaction_datetime_
206
206
  end
207
+
208
+ relation
207
209
  end
208
210
 
209
211
  # Use original primary_key for Active Record 8.0+ as much as possible
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module Bitemporal
5
- VERSION = "7.0.1"
5
+ VERSION = "7.0.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-bitemporal
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SmartHR
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 4.0.10
79
+ rubygems_version: 4.0.15
80
80
  specification_version: 4
81
81
  summary: BiTemporal Data Model for ActiveRecord
82
82
  test_files: []