Class: DuckRecord::Reflection::HasManyReflection

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

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from AssociationReflection

#foreign_type, #parent_reflection, #type

Attributes inherited from MacroReflection

#duck_record, #name, #options, #plural_name, #scope

Instance Method Summary collapse

Methods inherited from AssociationReflection

#active_record_primary_key, #add_as_source, #alias_candidate, #association_foreign_key, #association_primary_key_type, #association_scope_cache, #belongs_to?, #chain, #check_preloadable!, #check_validity!, #clear_association_scope_cache, #collect_join_chain, #compute_class, #constraints, #constructable?, #extensions, #foreign_key, #get_join_keys, #has_one?, #has_scope?, #initialize, #join_id_for, #join_keys, #join_scopes, #join_table, #klass, #klass_join_scope, #nested?, #primary_key_type, #quoted_table_name, #scope_chain, #scopes, #source_reflection, #table_name, #validate?

Methods inherited from MacroReflection

#==, #compute_class, #initialize, #klass

Methods inherited from AbstractReflection

#alias_candidate, #build_association, #check_validity!, #class_name

Constructor Details

This class inherits a constructor from DuckRecord::Reflection::AssociationReflection

Instance Method Details

#association_classObject



631
632
633
# File 'lib/duck_record/reflection.rb', line 631

def association_class
  Associations::HasManyAssociation
end

#association_primary_key(klass = nil) ⇒ Object



635
636
637
# File 'lib/duck_record/reflection.rb', line 635

def association_primary_key(klass = nil)
  primary_key(klass || self.klass)
end

#collection?Boolean

Returns:

  • (Boolean)


629
# File 'lib/duck_record/reflection.rb', line 629

def collection?; true; end

#macroObject



627
# File 'lib/duck_record/reflection.rb', line 627

def macro; :has_many; end