123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Reflection::AggregateReflection

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveRecord::Reflection::MacroReflection
Defined in: activerecord/lib/active_record/reflection.rb

Overview

Holds all the metadata about an aggregation as it was specified in the Active Record class.

Class Method Summary

MacroReflection - Inherited

AbstractReflection - Inherited

Instance Attribute Summary

MacroReflection - Inherited

#active_record, #autosave=,
#name

Returns the name of the macro.

#options

Returns the hash of options used for the macro.

#scope, #plural_name

AbstractReflection - Inherited

#counter_must_be_updated_by_has_many?,
#has_active_cached_counter?

Returns whether this association has a counter cache and its column values were backfilled (and so it is used internally by methods like size/any?/etc).

#has_cached_counter?

Returns whether this association has a counter cache.

#inverse_updates_counter_cache?
#inverse_updates_counter_in_memory?, #strict_loading?, #through_reflection?

Instance Method Summary

MacroReflection - Inherited

#==

Returns true if self and other_aggregation have the same name attribute, active_record attribute, and other_aggregation has an options hash assigned to it.

#compute_class,
#klass

Returns the class for the macro.

#scope_for, #derive_class_name, #normalize_options

AbstractReflection - Inherited

#alias_candidate,
#build_association

Returns a new, unsaved instance of the associated class.

#build_scope, #chain, #check_validity_of_inverse!,
#class_name

Returns the class name for the macro.

#constraints, #counter_cache_column, #inverse_of,
#inverse_which_updates_counter_cache

We need to avoid the following situation:

#join_scope, #join_scopes, #klass_join_scope,
#scopes

Returns a list of scopes that should be applied for this ::ActiveRecord::Reflection object when querying the database.

#strict_loading_violation_message, #table_name,
#actual_source_reflection

FIXME: this is a horrible name.

#ensure_option_not_given_as_class!, #predicate_builder, #primary_key

Constructor Details

This class inherits a constructor from ActiveRecord::Reflection::MacroReflection

Instance Method Details

#mapping

[ GitHub ]

  
# File 'activerecord/lib/active_record/reflection.rb', line 475

def mapping
  mapping = options[:mapping] || [name, name]
  mapping.first.is_a?(Array) ? mapping : [mapping]
end