Class: ActiveRecord::Reflection::HasAndBelongsToManyReflection

Inherits:
AssociationReflection show all
Defined in:
lib/active_record/reflection.rb

Overview

:nodoc:

Constant Summary

Constants inherited from AssociationReflection

AssociationReflection::INVALID_AUTOMATIC_INVERSE_OPTIONS, AssociationReflection::VALID_AUTOMATIC_INVERSE_MACROS

Instance Attribute Summary

Attributes inherited from AssociationReflection

#foreign_type, #parent_reflection, #type

Attributes inherited from MacroReflection

#active_record, #name, #options, #plural_name, #scope

Instance Method Summary collapse

Methods inherited from AssociationReflection

#active_record_primary_key, #add_as_polymorphic_through, #add_as_source, #add_as_through, #association_class, #association_foreign_key, #association_primary_key, #association_primary_key_type, #association_scope_cache, #belongs_to?, #check_preloadable!, #check_validity!, #clear_association_scope_cache, #collect_join_chain, #compute_class, #constructable?, #foreign_key, #has_inverse?, #has_one?, #has_scope?, #join_id_for, #join_table, #klass, #nested?, #polymorphic?, #polymorphic_inverse_of, #source_reflection, #through_reflection, #validate?

Methods inherited from MacroReflection

#==, #autosave=, #compute_class, #klass, #scope_for

Methods inherited from AbstractReflection

#alias_candidate, #build_association, #chain, #check_validity_of_inverse!, #class_name, #constraints, #counter_cache_column, #counter_must_be_updated_by_has_many?, #get_join_keys, #has_cached_counter?, #inverse_of, #inverse_updates_counter_in_memory?, #inverse_which_updates_counter_cache, #join_keys, #join_scopes, #klass_join_scope, #primary_key_type, #quoted_table_name, #scope_chain, #scopes, #table_name, #through_reflection?

Constructor Details

#initialize(name, scope, options, active_record) ⇒ HasAndBelongsToManyReflection

Returns a new instance of HasAndBelongsToManyReflection.



748
749
750
# File 'lib/active_record/reflection.rb', line 748

def initialize(name, scope, options, active_record)
  super
end

Instance Method Details

#collection?Boolean

Returns:

  • (Boolean)


754
755
756
# File 'lib/active_record/reflection.rb', line 754

def collection?
  true
end

#macroObject



752
# File 'lib/active_record/reflection.rb', line 752

def macro; :has_and_belongs_to_many; end