Sha256: ba65b64c22573fd6ba80f85cf4de22752d26b6b84ae941b8ce11fcf7093babd3
Contents?: true
Size: 771 Bytes
Versions: 38
Compression:
Stored size: 771 Bytes
Contents
# encoding: utf-8 module Mongoid # :nodoc: module Relations #:nodoc: module Cascading #:nodoc: class Strategy attr_accessor :document, :relation, :metadata # Initialize the new cascade strategy, which will set up the relation # and the metadata. # # @example Instantiate the strategy # Strategy.new(document, metadata) # # @param [ Document ] document The document to cascade from. # @param [ Metadata ] metadata The relation's metadata. # # @return [ Strategy ] The new strategy. def initialize(document, metadata) @document, @metadata = document, metadata @relation = document.send(metadata.name) end end end end end
Version data entries
38 entries across 38 versions & 4 rubygems