Class: Datamappify::Data::Criteria::Relational::FindByKey
- Includes:
- Concerns::SetCriteria
- Defined in:
- lib/datamappify/data/criteria/relational/find_by_key.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Common
#attributes, #attributes_and_values, #criteria, #entity, #options, #source_class
Instance Method Summary collapse
- #criteria_for_reverse_mapping ⇒ Object private
-
#initialize(source_class, entity, attributes, options = {}, &block) ⇒ FindByKey
constructor
A new instance of FindByKey.
Methods included from Concerns::SetCriteria
#criteria_for_normal_mapping, #set_criteria
Methods inherited from Find
Methods inherited from Common
#any_attribute, #default_source_class_name, #ignore?, #ignore_attribute?, #key_name, #key_value, #new_record?, #perform_with_callbacks, #pk, #primary_record?, #store_attribute_value
Constructor Details
#initialize(source_class, entity, attributes, options = {}, &block) ⇒ FindByKey
Returns a new instance of FindByKey.
11 12 13 |
# File 'lib/datamappify/data/criteria/relational/find_by_key.rb', line 11 def initialize(source_class, entity, attributes, = {}, &block) super(source_class, entity, nil, attributes, , &block) end |
Instance Method Details
#criteria_for_reverse_mapping ⇒ Object (private)
17 18 19 20 |
# File 'lib/datamappify/data/criteria/relational/find_by_key.rb', line 17 def criteria_for_reverse_mapping reverse_id = [:primary_record].send([:via]) reverse_id ? { :id => reverse_id } : {} end |