method
new
v7.2.3 -
Show latest stable
- Class:
ActiveRecord::Associations::Preloader::Branch
new(association:, children:, parent:, associate_by_default:, scope:)public
No documentation available.
# File activerecord/lib/active_record/associations/preloader/branch.rb, line 11
def initialize(association,, children,, parent,, associate_by_default,, scope))
@association = if association
begin
@association = association.to_sym
rescue NoMethodError
raise ArgumentError, "Association names must be Symbol or String, got: #{association.class.name}"
end
end
@parent = parent
@scope = scope
@associate_by_default = associate_by_default
@children = build_children(children)
@loaders = nil
end