Sha256: b8aae568758d444fa92ea28776338af4aa14fa484b3574284848b0655f0e22ef
Contents?: true
Size: 764 Bytes
Versions: 33
Compression:
Stored size: 764 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Collections #:nodoc: class Master attr_reader :collection # All read and write operations should delegate to the master connection. # These operations mimic the methods on a Mongo:Collection. # # Example: # # <tt>collection.save({ :name => "Al" })</tt> Operations::ALL.each do |name| define_method(name) { |*args| collection.send(name, *args) } end # Create the new database writer. Will create a collection from the # master database. # # Example: # # <tt>Master.new(master, "mongoid_people")</tt> def initialize(master, name) @collection = master.collection(name) end end end end
Version data entries
33 entries across 33 versions & 7 rubygems