Class: ActiveFedora::Reflection::ClassMethods::AssociationReflection
- Inherits:
-
MacroReflection
- Object
- MacroReflection
- ActiveFedora::Reflection::ClassMethods::AssociationReflection
- Defined in:
- lib/active_fedora/reflection.rb
Overview
Holds all the meta-data about an association as it was specified in the Active Record class.
Instance Attribute Summary
Attributes inherited from MacroReflection
Instance Method Summary collapse
-
#initialize(macro, name, options, active_record) ⇒ AssociationReflection
constructor
:nodoc:.
- #primary_key_name ⇒ Object
Methods inherited from MacroReflection
#build_association, #class_name, #collection?, #klass
Constructor Details
#initialize(macro, name, options, active_record) ⇒ AssociationReflection
:nodoc:
128 129 130 131 |
# File 'lib/active_fedora/reflection.rb', line 128 def initialize(macro, name, , active_record) super @collection = [:has_many, :has_and_belongs_to_many].include?(macro) end |
Instance Method Details
#primary_key_name ⇒ Object
133 134 135 |
# File 'lib/active_fedora/reflection.rb', line 133 def primary_key_name @primary_key_name ||= [:foreign_key] || derive_primary_key_name end |