Class: ROM::SQL::Associations::OneToMany

Inherits:
Associations::OneToMany
  • Object
show all
Includes:
SelfRef
Defined in:
lib/rom/sql/associations/one_to_many.rb

Direct Known Subclasses

OneToOne

Instance Method Summary collapse

Instance Method Details

#call(target: self.target) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/rom/sql/associations/one_to_many.rb', line 15

def call(target: self.target)
  schema = target.schema.qualified
  relation = target.join(source_table, join_keys)

  if view
    apply_view(schema, relation)
  else
    schema.(relation)
  end
end

#join(type, source = self.source, target = self.target) ⇒ Object



27
28
29
# File 'lib/rom/sql/associations/one_to_many.rb', line 27

def join(type, source = self.source, target = self.target)
  source.__send__(type, target.name.dataset, join_keys).qualified
end

#join_keysObject Originally defined in module SelfRef

#source_attrObject Originally defined in module SelfRef

#target_attrObject Originally defined in module SelfRef