Module: ChronoModel::Patches::Preloader
- Defined in:
- lib/chrono_model/patches/preloader.rb
Overview
Patches ActiveRecord::Associations::Preloader to add support for temporal associations. This is tying itself to Rails internals and it is ugly :-(.
Defined Under Namespace
Modules: Association, ThroughAssociation
Instance Attribute Summary collapse
-
#chronomodel_options ⇒ Object
readonly
Returns the value of attribute chronomodel_options.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Object
Overwrite the initializer to set Chronomodel
as_of_timeandmodeloptions.
Instance Attribute Details
#chronomodel_options ⇒ Object (readonly)
Returns the value of attribute chronomodel_options.
10 11 12 |
# File 'lib/chrono_model/patches/preloader.rb', line 10 def @chronomodel_options end |
Instance Method Details
#initialize(**options) ⇒ Object
Overwrite the initializer to set Chronomodel as_of_time and model
options.
15 16 17 18 19 20 |
# File 'lib/chrono_model/patches/preloader.rb', line 15 def initialize(**) @chronomodel_options = .extract!(:as_of_time, :model) [:scope] = chronomodel_scope([:scope]) if .key?(:scope) super end |