Class: NoBrainer::Document::Association::HasOne::Metadata

Inherits:
NoBrainer::Document::Association::HasMany::Metadata show all
Defined in:
lib/no_brainer/document/association/has_one.rb

Constant Summary

Constants inherited from NoBrainer::Document::Association::HasMany::Metadata

NoBrainer::Document::Association::HasMany::Metadata::VALID_OPTIONS

Instance Attribute Summary

Attributes included from Core::Metadata

#options, #owner_model, #target_name

Instance Method Summary collapse

Methods inherited from NoBrainer::Document::Association::HasMany::Metadata

#eager_load_owner_key, #eager_load_owner_type, #eager_load_target_key, #foreign_key, #foreign_type, #hook, #inverses, #primary_key

Methods included from EagerLoader::Generic

#eager_load

Methods included from Core::Metadata

#add_callback_for, #association_model, #delegate, #get_model_by_name, #hook, #initialize, #new

Instance Method Details

#base_criteriaObject



7
8
9
# File 'lib/no_brainer/document/association/has_one.rb', line 7

def base_criteria
  super.without_ordering
end

#target_modelObject



3
4
5
# File 'lib/no_brainer/document/association/has_one.rb', line 3

def target_model
  get_model_by_name(options[:class_name] || target_name.to_s.camelize)
end