class Sequel::Model::Associations::AssociationReflection

be instantiated by the user.
provides methods to reduce internal code duplication. It should not
AssociationReflection is a Hash subclass that keeps information on Sequel::Model associations. It

def _add_method

Name symbol for the _add internal association method
def _add_method
  :"_add_#{singularize(self[:name])}"
end

def _dataset_method

Name symbol for the _dataset association method
def _dataset_method
  :"_#{self[:name]}_dataset"
end

def _remove_all_method

Name symbol for the _remove_all internal association method
def _remove_all_method
  :"_remove_all_#{self[:name]}"
end

def _remove_method

Name symbol for the _remove internal association method
def _remove_method
  :"_remove_#{singularize(self[:name])}"
end

def _setter_method

Name symbol for the _setter association method
def _setter_method
  :"_#{self[:name]}="
end

def add_method

Name symbol for the add association method
def add_method
  :"add_#{singularize(self[:name])}"
end

def associated_class

The class associated to the current model class via this association
def associated_class
  self[:class] ||= constantize(self[:class_name])
end

def association_method

Name symbol for association method, the same as the name of the association.
def association_method
  self[:name]
end

def can_have_associated_objects?(obj)

the necessary key columns are NULL.
object. Should be false if obj cannot have associated objects because
Whether this association can have associated objects, given the current
def can_have_associated_objects?(obj)
  true
end

def dataset_helper_method

Name symbol for the _helper internal association method
def dataset_helper_method
  :"_#{self[:name]}_dataset_helper"
end

def dataset_method

Name symbol for the dataset association method
def dataset_method
  :"#{self[:name]}_dataset"
end

def dataset_need_primary_key?

Whether the dataset needs a primary key to function, true by default.
def dataset_need_primary_key?
  true
end

def eager_graph_lazy_dataset?

when loading the association for a single record.
is false, the association won't respect the :eager_graph option
Whether to eagerly graph a lazy dataset, true by default. If this
def eager_graph_lazy_dataset?
  true
end

def eager_limit_strategy

The eager limit strategy to use for this dataset.
def eager_limit_strategy
  fetch(:_eager_limit_strategy) do
    self[:_eager_limit_strategy] = if self[:limit]
      case s = self.fetch(:eager_limit_strategy){self[:model].default_eager_limit_strategy || :ruby}
      when true
        ds = associated_class.dataset
        if ds.supports_window_functions?
          :window_function
        else
          :ruby
        end
      else
        s
      end
    else
      nil
    end
  end
end

def eager_loading_use_associated_key?

to eagerly load.
By default associations do not need to select a key in an associated table
def eager_loading_use_associated_key?
  false
end

def limit_and_offset

The limit and offset for this association (returned as a two element array).
def limit_and_offset
  if (v = self[:limit]).is_a?(Array)
    v
  else
    [v, nil]
  end
end

def need_associated_primary_key?

false by default.
Whether the associated object needs a primary key to be added/removed,
def need_associated_primary_key?
  false
end

def qualify(table, col)

return an array of qualified columns.
Qualify +col+ with the given table name. If +col+ is an array of columns,
def qualify(table, col)
  transform(col){|k| SQL::QualifiedIdentifier.new(table, k)}
end

def qualify_assoc(col)

Qualify col with the associated model's table name.
def qualify_assoc(col)
  qualify(associated_class.table_name, col)
end

def qualify_cur(col)

Qualify col with the current model's table name.
def qualify_cur(col)
  qualify(self[:model].table_name, col)
end

def reciprocal

it sets album.artist to this_artist.
to populate reciprocal associations. For example, when you do this_artist.add_album(album)
Artist.one_to_many :albums are reciprocal associations. This information is
of the current association. For example, Album.many_to_one :artist and
association is the association in the associated class that is the opposite
Returns the reciprocal association variable, if one exists. The reciprocal
def reciprocal
  return self[:reciprocal] if include?(:reciprocal)
  r_types = Array(reciprocal_type)
  keys = self[:keys]
  associated_class.all_association_reflections.each do |assoc_reflect|
    if r_types.include?(assoc_reflect[:type]) && assoc_reflect[:keys] == keys && assoc_reflect.associated_class == self[:model]
      self[:reciprocal_type] = assoc_reflect[:type]
      return self[:reciprocal] = assoc_reflect[:name]
    end
  end
  self[:reciprocal] = nil
end

def reciprocal_array?

true by default.
Whether the reciprocal of this association returns an array of objects instead of a single object,
def reciprocal_array?
  true
end

def remove_all_method

Name symbol for the remove_all_ association method
def remove_all_method
  :"remove_all_#{self[:name]}"
end

def remove_before_destroy?

being destroyed in order to preserve referential integrity.
Whether associated objects need to be removed from the association before
def remove_before_destroy?
  true
end

def remove_method

Name symbol for the remove_ association method
def remove_method
  :"remove_#{singularize(self[:name])}"
end

def remove_should_check_existing?

Whether to check that an object to be disassociated is already associated to this object, false by default.
def remove_should_check_existing?
  false
end

def returns_array?

true by default.
Whether this association returns an array of objects instead of a single object,
def returns_array?
  true
end

def select

The columns to select when loading the association.
def select
  self[:select]
end

def set_reciprocal_to_self?

records, false by default.
Whether to set the reciprocal association to self when loading associated
def set_reciprocal_to_self?
  false
end

def setter_method

Name symbol for the setter association method
def setter_method
  :"#{self[:name]}="
end

def transform(s)

block with +s+.
If +s+ is an array, map +s+ over the block. Otherwise, just call the
def transform(s)
  s.is_a?(Array) ? s.map(&Proc.new) : (yield s)
end