Class: DuckRecord::Reflection::BelongsToReflection

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, #association_primary_key_type, #association_scope_cache, #chain, #check_preloadable!, #check_validity!, #clear_association_scope_cache, #collect_join_chain, #collection?, #compute_class, #constraints, #constructable?, #extensions, #foreign_key, #get_join_keys, #has_one?, #has_scope?, #initialize, #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



607
608
609
# File 'lib/duck_record/reflection.rb', line 607

def association_class
  Associations::BelongsToAssociation
end

#belongs_to?Boolean

Returns:

  • (Boolean)


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

def belongs_to?; true; end

#join_id_for(owner) ⇒ Object

:nodoc:



611
612
613
# File 'lib/duck_record/reflection.rb', line 611

def join_id_for(owner) # :nodoc:
  owner[foreign_key]
end

#macroObject



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

def macro; :belongs_to; end