Class: CaRuby::Database::FetchedMatcher
- Inherits:
-
Object
- Object
- CaRuby::Database::FetchedMatcher
- Defined in:
- lib/caruby/database/fetched_matcher.rb
Overview
Helper that matches fetched sources to targets.
Direct Known Subclasses
Instance Method Summary collapse
-
#match(sources, targets, from, attribute) ⇒ {Jinx::Resource => Jinx::Resource}
Returns a target => source match hash for the given targets and sources using Jinx::Resource#match_in_owner_scope.
Instance Method Details
#match(sources, targets, from, attribute) ⇒ {Jinx::Resource => Jinx::Resource}
Returns a target => source match hash for the given targets and sources using Jinx::Resource#match_in_owner_scope.
caCORE alert = caCORE does not enforce reference identity integrity, i.e. a search on object a with database record references a => b => a, the search result might be a => b => a’, where a.identifier == _a’.identifier_. This visit method remedies this caCORE defect by matching source references on a previously matched identifier where possible.
21 22 23 24 25 26 27 28 29 |
# File 'lib/caruby/database/fetched_matcher.rb', line 21 def match(sources, targets, from, attribute) if sources.empty? or targets.empty? then Hash::EMPTY_HASH elsif from.class.property(attribute).owner? then match_owner(sources.first, targets.first, from, attribute) else match_fetched(sources, targets) end end |