lib/mongoid/criteria/includable.rb
# Add an inclusion definition to the list of inclusions for the criteria.
#
# @param [ Association ] association The association.
# @param [ String ] parent The name of the association above this one in
#   the inclusion tree, if it is a nested inclusion.
Add an inclusion definition to the list of inclusions for the criteria.
Add an inclusion definition to the list of inclusions for the criteria .
def add_inclusion(association, parent = nil)
        if assoc = inclusions.detect { |a| a == association }
          assoc.parent_inclusions.push(parent) if parent
        else
          assoc = association.dup
          assoc.parent_inclusions = []
          assoc.parent_inclusions.push(parent) if parent
          inclusions.push(assoc)
        end
      end
def add_inclusion ( association , parent = nil ) if assoc = inclusions . detect { | a | a == association } assoc . parent_inclusions . push ( parent ) if parent else assoc = association . dup assoc . parent_inclusions = [ ] assoc . parent_inclusions . push ( parent ) if parent inclusions . push ( assoc ) end end
Add an inclusion definition to the list of inclusions for the criteria.
Add an inclusion definition to the list of inclusions for the criteria .
association
<not_specific>
parent
<not_specific>
<not_specific>
parent The name of the association above this one in the inclusion tree, if it is a nested inclusion.
parent The name of the association above this one in the inclusion tree if it is a nested inclusion .