Skip to content

Commit

Permalink
Merge pull request #308 from ifad/chore/fix-comments
Browse files Browse the repository at this point in the history
Improve comments
  • Loading branch information
tagliala authored Jun 2, 2024
2 parents ff20e42 + 392a8bb commit 6e50ef2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/chrono_model/patches/preloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions lib/chrono_model/time_machine/history_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6e50ef2

Please sign in to comment.