module PlainModel::Querying::Includes

Public Instance Methods

includes(*names) click to toggle source

Chain method @param names [Array<Symbol,Hash>] - names of includes with optional tail hash for nested includes @return new instance with applied changes

# File lib/plain_model/querying/includes.rb, line 19
def includes(*names)
  dup.includes!(*names)
end
includes!(*names) click to toggle source

Chain method @param names [Array<Symbol,Hash>] - names of includes with optional tail hash for nested includes @return current instance with applied changes

# File lib/plain_model/querying/includes.rb, line 26
def includes!(*names)
  new_includes = ::PlainModel::MergeIncludes.new(values[:includes]).merge(names)
  values[:includes] = new_includes
  self
end
initial_values() click to toggle source
Calls superclass method
# File lib/plain_model/querying/includes.rb, line 12
def initial_values
  super.merge includes: {}
end