class ROM::LDAP::Associations::OneToMany

Public Instance Methods

call(target: self.target) click to toggle source

@api public

# 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