Module: ROM::LDAP::Associations::Core Private

Included in:
OneToMany
Defined in:
lib/rom/ldap/associations/core.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Core LDAP association API

Instance Method Summary collapse

Instance Method Details

#preload(target, loaded) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Used when relation association override is not true



15
16
17
18
19
# File 'lib/rom/ldap/associations/core.rb', line 15

def preload(target, loaded)
  source_key, target_key = join_keys.flatten(1)
  target_pks = loaded.pluck(source_key.key).flatten.uniq
  target.where(target_key.key => target_pks)
end