Sha256: f37931354bf4922994821392fc2197500ed465af7cd80c35d1ec83a649e24c21
Contents?: true
Size: 675 Bytes
Versions: 3
Compression:
Stored size: 675 Bytes
Contents
require 'rom/associations/abstract' module ROM module Associations class ManyToOne < Abstract # @api public def call(*) raise NotImplementedError end # @api public def foreign_key definition.foreign_key || source.foreign_key(target.name) end # @api private def associate(child, parent) fk, pk = join_key_map child.merge(fk => parent.fetch(pk)) end protected # @api protected def source_key foreign_key end # @api protected def target_key target.schema.primary_key_name end memoize :foreign_key end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rom-core-4.0.0.beta3 | lib/rom/associations/many_to_one.rb |
rom-core-4.0.0.beta2 | lib/rom/associations/many_to_one.rb |
rom-core-4.0.0.beta1 | lib/rom/associations/many_to_one.rb |