All Scope of dependent association.

 @return [Array<ActiveRecord::Relation>] array of dependent association.
486160
def dependent_association_scopes
      self.class.reflect_on_all_associations.select { |reflection|
        reflection.options[:dependent] == :destroy and reflection.klass.paranoid?
      }.map { |reflection|
        self.association(reflection.name).tap {|assoc| assoc.reset_scope }.scope
      }
    end
485674
def associations
      @associations ||= Hash[metadata.xpath('//Association').collect do |association_definition|
        [
            association_definition.attributes['Name'].value,
            build_association(association_definition)
        ]
      end]
    end
1168957
def relations(cls):
        
        return [c.key for c in cls.__mapper__.iterate_properties
                if isinstance(c, RelationshipProperty)]
26584
def dependents(self, on_predicate=None, from_predicate=None):
    
    core = set(self.targets(on_predicate))
    dependees = defaultdict(set)
    for target in self.targets(from_predicate):
      for dependency in target.dependencies:
        if dependency in core:
          dependees[target].add(dependency)
    return dependees
1001331
def association_chain
        @association_chain ||=
          symbols_for_association_chain.inject([begin_of_association_chain]) do |chain, symbol|
            chain << evaluate_parent(symbol, resources_configuration[symbol], chain.last)
          end.compact.freeze
      end
723382
def get_full_dependents(self, term_id, relations, counter = 0):
        
        counter += 1
        deps = self.relations_for_term
        if term_id in deps and len(deps.get(term_id)) > 0:
            for dep in deps.get(term_id):
                if not dep[1] in relations:
                    relations.append(dep[1])
                    if dep[1] in deps:
                        deprelations = self.get_full_dependents(dep[1], relations, counter)
                        for deprel in deprelations:
                            if not deprel in relations:
                                relations.append(deprel)

        return relations
414758
def collection
      get_collection_ivar || begin
        chain = end_of_association_chain

        # scopes
        chain = apply_scopes(chain)

        # search
        if params[:search]
          chain = chain.search(params[:search].to_s.downcase, match: :all)
        end

        # pagination
        if params[:page]
          per_page = params[:perPage] || 20
          chain    = chain.page(params[:page]).per(per_page)
        else
          chain = chain.all
        end

        set_collection_ivar(chain)
      end
    end
222580
Set<String> dependences() {
        return analyzer.archives().stream()
                       .map(analyzer::dependences)
                       .flatMap(Set::stream)
                       .collect(Collectors.toSet());
    }
650176
def each_association( objectpath )
    begin
      @client.associators(objectpath).each do |assoc|
        yield assoc
      end
    rescue Sfcc::Cim::ErrorInvalidClass, Sfcc::Cim::ErrorInvalidNamespace
    end
  end
532091
def scope_for_slug_generator
      relation = super
      return relation if new_record?
      relation = relation.merge(Slug.where('sluggable_id <> ?', id))
      if friendly_id_config.uses?(:scoped)
        relation = relation.where(Slug.arel_table[:scope].eq(serialized_scope))
      end
      relation
    end
212277
def child_relationships
      child_relationships = []

      relationships.each do |relationship|
        next unless relationship.respond_to?(:collection_for)
        set_default_value(relationship)
        next unless relationship.loaded?(self)

        child_relationships << relationship
      end

      many_to_many, other = child_relationships.partition do |relationship|
        relationship.kind_of?(Associations::ManyToMany::Relationship)
      end

      many_to_many + other
    end
639427
protected function eagerLoadRelations()
    {
        $query = $this->model;

        if (is_array($this->eagerLoadRelations)) {
            $eagerLoads = [];

            foreach ($this->eagerLoadRelations as $relation => $rules) {
                // case for relations[]=relation_name
                // with relation that is numeric
                $relation = (is_integer($relation)) ? $rules : $relation;

                // case for relations[relation_name][attributes][]=attrib_name
                // with relation that is a relation name
                if (is_array($rules) && array_key_exists('attributes', $rules)) {
                    $eagerLoads[$relation] = function ($q) use ($rules) {
                        // If query is instance of HasOneOrMany,
                        // make sure to select the parent key name as foreign key.
                        if (
                            $q instanceof HasOneOrMany &&
                            !in_array($fk = $q->getParent()->getForeignKey(), $rules['attributes'])
                        ) {
                            array_push($rules['attributes'], $fk);
                        }

                        $q->select($rules['attributes']);
                    };
                } else {
                    array_push($eagerLoads, $relation);
                }
            }

            return $query->with($eagerLoads);
        }

        return $query->with($this->eagerLoadRelations);
    }
913287
def reflect_on_all_associations klass
        klass.relationships.collect do |relationship|
          # All can be child/parent
          # ManyToMany
          # ManyToOne
          # OneToMany
          # OneToOne
          #TODO :has_and_belongs_to_many
          if relationship.kind_of?(::DataMapper::Associations::ManyToOne::Relationship) && relationship.child_model? #relationship.options[:min] == 1 && relationship.options[:max] == 1
            macro = :belongs_to
            if relationship.options[:class_name]
              # In a belongs_to, the side with the class name uses
              # the parent model, but child key for the foreign key...
              class_name = relationship.parent_model.to_s
              primary_key_name = relationship.child_key.entries.first.name
            else
              class_name = relationship.child_model.to_s
              primary_key_name = relationship.parent_key.entries.first.name
            end
          else
            macro = :has_one
            if relationship.options[:class_name]
              # but on the has_one side, it's the *child* model that
              # uses the child key for the foreign key.  Weirdness.
              class_name = relationship.child_model.to_s
              primary_key_name = relationship.child_key.entries.first.name
            else
              class_name = relationship.parent_model.to_s
              primary_key_name = relationship.parent_key.entries.first.name
            end
          end
          OpenStruct.new(
            :name => relationship.name,
            :options => {
              #:foreign_key => , # Ignore, let the calling code infer: {name}_id
              :polymorphic => false # Hard code for now
            },
            :class_name => class_name,
            :primary_key_name => primary_key_name,
            :macro => macro
          )
        end
      end
642328
def dependencies( scopes = nil)
      if scopes
        unless scopes.is_a? Array
           scopes = [scopes]
        end
      end
          
      if Naether.platform == 'java'
        if scopes.nil?
          deps = @project.getDependenciesNotation()
        else
          deps = @project.getDependenciesNotation( scopes )
        end
        
      elsif scopes
        list = Naether::Java.convert_to_java_list( scopes )

        deps = @project._invoke('getDependenciesNotation', 'Ljava.util.List;', list)
      else
        deps = @project.getDependenciesNotation()
      end

      
      Naether::Java.convert_to_ruby_array( deps, true )
    end
729357
public function accessibleRelationsToArray()
	{
		$filtered  = [];
		$relations = $this->getArrayableRelations();

		/**
		 * @var $related \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Relations\Pivot
		 */
		foreach ($relations as $key => $related_collection) {
			if (! $this->access_authorizer->canAccess($key)) {
				continue;
			}

			if ($related_collection instanceof Pivot) {
				// Access test done above
				$filtered[$key] = $related_collection;
				continue;
			}

			// Many relation
			if ($related_collection instanceof Collection) {
				foreach ($related_collection as $index => $related) {
					$filtered[$key][$index] = $related->accessibleAttributesToArray();
				}
			} elseif ($related_collection instanceof LaravelModel) {
				// Single relation
				$filtered[$key] = $related_collection->accessibleAttributesToArray();
			}
		}

		return $filtered;
	}
625702
public java.util.List<InstanceAssociation> getAssociations() {
        if (associations == null) {
            associations = new com.amazonaws.internal.SdkInternalList<InstanceAssociation>();
        }
        return associations;
    }
1142997
def parents
      @parents ||= Array(nesting).map do |p|
        if p.is_a?(Class) && p < ActiveRecord::Base
          parent_entry(p)
        else
          p
        end
      end
    end