class ROM::SQL::Associations::OneToMany

Public Instance Methods

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

@api public

# 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) click to toggle source

@api public

# 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