Class: ROM::LDAP::Associations::OneToMany
- Inherits:
-
Associations::OneToMany
- Object
- Associations::OneToMany
- ROM::LDAP::Associations::OneToMany
- Defined in:
- lib/rom/ldap/associations/one_to_many.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods included from SelfRef
included, #join_keys, #source_attr, #target_attr
Methods included from Core
Instance Method Details
#call(target: self.target) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rom/ldap/associations/one_to_many.rb', line 17 def call(target: self.target) schema = target.schema target_fks = target.list(foreign_key).uniq relation = source.where(source.primary_key => target_fks) if view apply_view(schema, relation) else schema.call(relation) end end |