Creates methods that allows an +association+ to be monitored.

 The +association+ parameter should be a string or symbol representing the name of an association.
763342
def monitor_association_changes(association)
      define_method "#{association}=" do |value|
        attribute_will_change!(association.to_s) if _association_will_change?(association, value)
        super(value)
      end

      ids = "#{association.to_s.singularize}_ids"

      define_method "#{ids}=" do |value|
        attribute_will_change!(association.to_s) if _ids_will_change?(ids, value)
        super(value)
      end

      define_method "#{association}_attributes=" do |value|
        attribute_will_change!(association.to_s) if _nested_attributes_will_change?(value)
        super(value)
      end

      [association, ids].each do |name|
        define_method "#{name}_change" do
          changes[name]
        end

        define_method "#{name}_changed?" do
          changes.has_key?(association.to_s)
        end

        define_method "#{name}_previously_changed?" do
          previous_changes.has_key?(association.to_s)
        end
      end
    end
1100439
def association_with_root_model(method_name)
      persistor = self.persistor || (respond_to?(:save_to) && save_to && save_to.persistor)

      # Check if we are on the store collection
      if persistor.is_a?(Volt::Persistors::ModelStore) ||
         persistor.is_a?(Volt::Persistors::Page)
        # Get the root node
        root = persistor.try(:root_model)

        # Yield to the block passing in the root node
        yield(root)
      else
        # raise an error about the method not being supported on this collection
        fail "#{method_name} currently only works on the store and page collection (support for other collections coming soon)"
      end
    end
5735
def ensure_valid_associated_record(association)
      value = send(association)
      predicate = :"#{association}?"

      if !value.class.respond_to?(predicate) || !value.class.send(predicate)
        errors.add association, I18n.t(:invalid, scope: [:errors, :messages])
      end
    end
586804
public void setAssociationExecutions(java.util.Collection<AssociationExecution> associationExecutions) {
        if (associationExecutions == null) {
            this.associationExecutions = null;
            return;
        }

        this.associationExecutions = new com.amazonaws.internal.SdkInternalList<AssociationExecution>(associationExecutions);
    }
697025
def multiple?(method_name)
      return false if association(method_name).nil?

      name = association(method_name).respond_to?(:many?) ? :many? : :collection?
      association(method_name).send(name)
    end
713114
def indicator_associations_types(
        self, indicator_type, api_entity=None, api_branch=None, params=None
    ):
        
        if params is None:
            params = {}
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        target = self._tcex.ti.indicator(indicator_type)
        for at in self.tc_requests.indicator_associations_types(
            self.api_type,
            self.api_sub_type,
            self.unique_id,
            target,
            api_entity=api_entity,
            api_branch=api_branch,
            owner=self.owner,
            params=params,
        ):
            yield at
428366
def set_association_id(self, assoc_id=None):
        
        if assoc_id is None:
            self.assoc_id = self.make_association_id(
                self.definedby, self.sub, self.rel, self.obj)
        else:
            self.assoc_id = assoc_id

        return self.assoc_id
627831
function(association, name) {
    var context = this._relationCallContext;
    var through = association.indexOf('.') !== -1 ?
      util.format(' through %s', association) : '';
    return _.extend(new Error(util.format(
      'No relation %j found for `%s` on %s query%s.',
      name, context, this._model.__identity__.__name__, through)), {
      code: 'RELATION_ITERATION_FAILURE',
    });

  }
1184423
def make_association(self, record):
        
        # prep record
        # remove description and mapp Experiment Type to apo term
        experiment_type = record['Experiment Type'].split('(')[0]
        experiment_type = experiment_type.split(',')
        record['experiment_type'] = list()
        for exp_type in experiment_type:
            exp_type = exp_type.lstrip().rstrip()
            record['experiment_type'].append(
                {
                    'id': self.apo_term_id[exp_type],
                    'term': exp_type,
                })
        sgd_phenotype = record['Phenotype']
        pheno_obj = {
            'entity': {
                'term': None,
                'apo_id': None
            },
            'quality': {
                'term': None,
                'apo_id': None
            },
            'has_quality': False  # descriptive and don't bother looking for a quality
        }
        phenotype = record['Phenotype']
        if ':' in phenotype:
            pheno_obj['has_quality'] = True
            ent_qual = sgd_phenotype.split(': ')
            entity = ent_qual[0]
            quality = ent_qual[1]
            pheno_obj['entity']['term'] = entity
            pheno_obj['entity']['apo_id'] = self.apo_term_id[entity]
            pheno_obj['quality']['term'] = quality
            pheno_obj['quality']['apo_id'] = self.apo_term_id[quality]
        else:
            pheno_obj['entity']['term'] = phenotype
            pheno_obj['entity']['apo_id'] = self.apo_term_id[phenotype]
        record['pheno_obj'] = pheno_obj

        # begin modeling
        model = Model(self.graph)

        # define the triple
        gene = 'SGD:{}'.format(record['SGDID'])
        relation = self.globaltt['has phenotype']

        if record['pheno_obj']['has_quality']:
            pheno_label = '{0}:{1}'.format(
                record['pheno_obj']['entity']['term'],
                record['pheno_obj']['quality']['term'])
            pheno_id = 'MONARCH:{0}{1}'.format(
                record['pheno_obj']['entity']['apo_id'].replace(':', '_'),
                record['pheno_obj']['quality']['apo_id'].replace(':', '_')
            )
            g2p_assoc = Assoc(
                self.graph, self.name, sub=gene, obj=pheno_id, pred=relation)
        else:
            pheno_label = record['pheno_obj']['entity']['term']
            pheno_id = record['pheno_obj']['entity']['apo_id']
            g2p_assoc = Assoc(
                self.graph, self.name, sub=gene, obj=pheno_id, pred=relation)
            assoc_id = g2p_assoc.make_association_id(
                'yeastgenome.org', gene, relation, pheno_id)
            g2p_assoc.set_association_id(assoc_id=assoc_id)

        # add to graph to mint assoc id
        g2p_assoc.add_association_to_graph()

        model.addLabel(subject_id=gene, label=record['Gene Name'])

        # add the association triple
        model.addTriple(subject_id=gene, predicate_id=relation, obj=pheno_id)

        model.addTriple(
            subject_id=pheno_id,
            predicate_id=self.globaltt['subclass_of'],
            obj=self.globaltt['Phenotype'])

        # label nodes
        # pheno label

        model.addLabel(subject_id=pheno_id, label=pheno_label)

        g2p_assoc.description = self._make_description(record)

        # add the references
        references = record['Reference']
        references = references.replace(' ', '')
        references = references.split('|')

        #  created Ref prefix in curie map to route to proper reference URL in SGD
        if len(references) > 0:
            # make first ref in list the source
            g2p_assoc.add_source(identifier=references[0])
            ref_model = Reference(
                self.graph, references[0],
                self.globaltt['publication']
            )
            ref_model.addRefToGraph()

        if len(references) > 1:
            # create equivalent source for any other refs in list
            for ref in references[1:]:
                model.addSameIndividual(sub=references[0], obj=ref)

        # add experiment type as evidence
        for exp_type in record['experiment_type']:
            g2p_assoc.add_evidence(exp_type['id'])
            model.addLabel(subject_id=exp_type['id'], label=exp_type['term'])

        try:
            g2p_assoc.add_association_to_graph()
        except Exception as e:
            print(e)
        return
409446
def method_missing(name, *args)
      if name.to_s == "#{model_name.underscore}_params"
        return params.reject{|k,v| %w(splat captures id updated_at created_at).include? k}
      end
    end
1351193
def fetch_association(name, includes=nil)
      association = fetch_property(name)

      if includes.present? && ! @resource.association(name).loaded?
        association.includes(includes)
      else
        association
      end
    end
718712
private void createCountersManager() {
        UnsafeBuffer counterLabelsBuffer = monitorFileWriter.createServiceCounterLabelsBuffer(index);
        UnsafeBuffer counterValuesBuffer = monitorFileWriter.createServiceCounterValuesBuffer(index);

        countersManager = new CountersManager(counterLabelsBuffer, counterValuesBuffer);
    }
572501
def save_bt_association(assoc, version)
      assoc_version_args = {
        version_id: version.id,
        foreign_key_name: assoc.foreign_key
      }

      if assoc.options[:polymorphic]
        foreign_type = @record.send(assoc.foreign_type)
        if foreign_type && ::PaperTrail.request.enabled_for_model?(foreign_type.constantize)
          assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
          assoc_version_args[:foreign_type] = foreign_type
        end
      elsif ::PaperTrail.request.enabled_for_model?(assoc.klass)
        assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
        assoc_version_args[:foreign_type] = assoc.klass
      end

      if assoc_version_args.key?(:foreign_key_id)
        ::PaperTrail::VersionAssociation.create(assoc_version_args)
      end
    end
544755
def relationnal_result(method_name, *arguments)
      self.class.reload_fields_definition(false)
      if self.class.many2one_associations.has_key?(method_name)
        load_m2o_association(method_name, *arguments)
      elsif self.class.polymorphic_m2o_associations.has_key?(method_name)# && @associations[method_name]
        load_polymorphic_m2o_association(method_name, *arguments)
#        values = @associations[method_name].split(',')
#        self.class.const_get(values[0]).find(values[1], arguments.extract_options!)
      else # o2m or m2m
        load_x2m_association(method_name, *arguments)
      end
    end
541082
def predicate_visitor
      join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, association_joins, custom_joins)
      MetaWhere::Visitors::Predicate.new(join_dependency)
    end
1325834
public static HibernateProxy getAssociationProxy(Object obj, String associationName) {
        return proxyHandler.getAssociationProxy(obj, associationName);
    }
407886
public AspFactory createAspFactory(String aspName, String associationName) throws Exception {
        return this.createAspFactory(aspName, associationName, false);
    }