Class: ActiveFedora::Reflection::RDFPropertyReflection

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

Constant Summary

Constants inherited from AssociationReflection

AssociationReflection::INVALID_AUTOMATIC_INVERSE_OPTIONS, AssociationReflection::VALID_AUTOMATIC_INVERSE_MACROS

Instance Attribute Summary

Attributes inherited from AssociationReflection

#parent_reflection

Attributes inherited from MacroReflection

#active_fedora, #macro, #name, #options, #scope

Instance Method Summary collapse

Methods inherited from AssociationReflection

#association_class, #belongs_to?, #check_validity!, #check_validity_of_inverse!, #collect_join_chain, #collection?, #constructable?, #create_association, #foreign_key, #has_and_belongs_to_many?, #has_inverse?, #has_many?, #inverse_of, #predicate, #predicate_for_solr, #solr_key, #validate?

Methods inherited from MacroReflection

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

Methods inherited from AbstractReflection

#alias_candidate, #build_association, #chain, #check_validity_of_inverse!, #class_name, #constraints, #inverse_of, #through_reflection?

Constructor Details

#initialize(*args) ⇒ RDFPropertyReflection

Returns a new instance of RDFPropertyReflection.



455
456
457
458
# File 'lib/active_fedora/reflection.rb', line 455

def initialize(*args)
  super
  active_fedora.index_config[name] = build_index_config
end

Instance Method Details

#derive_class_nameObject



464
465
466
467
468
# File 'lib/active_fedora/reflection.rb', line 464

def derive_class_name
  class_name = name.to_s.sub(/_ids?$/, '').camelize
  class_name = class_name.singularize if collection?
  class_name
end

#derive_foreign_keyObject



460
461
462
# File 'lib/active_fedora/reflection.rb', line 460

def derive_foreign_key
  name
end