Sha256: 8983aabbcaf631a901a54a1cbe9b900a018a64d59ed53c221e9b46c288697c1b

Contents?: true

Size: 385 Bytes

Versions: 3

Compression:

Stored size: 385 Bytes

Contents

# -*- encoding : utf-8 -*-

require 'guacamole/proxies/proxy'

module Guacamole
  module Proxies
    # The {References} proxy is used to represent the 'many' in one-to-many relations.
    class References < Proxy
      def initialize(ref, document)
        init nil,
             -> { DocumentModelMapper.collection_for(ref).by_key(document["#{ref}_id"]) }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
guacamole-0.3.0 lib/guacamole/proxies/references.rb
guacamole-0.2.0 lib/guacamole/proxies/references.rb
guacamole-0.1.0 lib/guacamole/proxies/references.rb