Sha256: 54377f785253604f97774d3e6a982cdfd7af4cc3f429c2af2f2877fc39f54711
Contents?: true
Size: 485 Bytes
Versions: 53
Compression:
Stored size: 485 Bytes
Contents
# encoding: utf-8 module Mongoid module Relations module Eager class HasOne < Base def preload @docs.each do |d| set_relation(d, nil) end each_loaded_document do |doc| id = doc.send(key) set_on_parent(id, doc) end end def group_by_key @metadata.primary_key end def key @metadata.foreign_key end end end end end
Version data entries
53 entries across 48 versions & 3 rubygems