diff --git a/lib/chrono_model/patches/preloader.rb b/lib/chrono_model/patches/preloader.rb index c265aee..7fe6b8b 100644 --- a/lib/chrono_model/patches/preloader.rb +++ b/lib/chrono_model/patches/preloader.rb @@ -9,8 +9,8 @@ module Patches module Preloader attr_reader :chronomodel_options - # We overwrite the initializer in order to pass the +as_of_time+ - # parameter above in the build_preloader + # Overwrite the initializer to set Chronomodel +as_of_time+ and +model+ + # options. # def initialize(**options) @chronomodel_options = options.extract!(:as_of_time, :model) diff --git a/lib/chrono_model/time_machine/history_model.rb b/lib/chrono_model/time_machine/history_model.rb index f3c96d2..a119464 100644 --- a/lib/chrono_model/time_machine/history_model.rb +++ b/lib/chrono_model/time_machine/history_model.rb @@ -11,7 +11,6 @@ module HistoryModel scope :chronological, -> { order(Arel.sql('lower(validity) ASC')) } end - # ACTIVE RECORD 7 does not call `class.find` but a new internal method called `_find_record` def _find_record(options) if options && options[:lock] self.class.preload(strict_loaded_associations).lock(options[:lock]).find_by!(hid: hid) @@ -222,8 +221,8 @@ def valid_to end alias as_of_time valid_to - # Starting from Rails 6.0, `.read_attribute` will use the memoized - # `primary_key` if it detects that the attribute name is `id`. + # `.read_attribute` uses the memoized `primary_key` if it detects + # that the attribute name is `id`. # # Since the `primary key` may have been changed to `hid` because of # `.find` overload, the new behavior may break relations where `id` is