Sha256: f7939c736b0e03a5c5b970413b7c2bf909e8fcfeb9c24b54bcd0572abe062036

Contents?: true

Size: 710 Bytes

Versions: 18

Compression:

Stored size: 710 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Collections #:nodoc:
    class Master
      include Mimic

      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>
      proxy(:collection, Operations::ALL)

      # 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

18 entries across 18 versions & 2 rubygems

Version Path
mongoid-pre-2.0.0.beta1 lib/mongoid/collections/master.rb
mongoid-2.0.0.alpha lib/mongoid/collections/master.rb
mongoid-1.2.14 lib/mongoid/collections/master.rb
mongoid-1.2.13 lib/mongoid/collections/master.rb
mongoid-1.2.12 lib/mongoid/collections/master.rb
mongoid-1.2.11 lib/mongoid/collections/master.rb
mongoid-1.2.10 lib/mongoid/collections/master.rb
mongoid-1.2.9 lib/mongoid/collections/master.rb
mongoid-1.2.8 lib/mongoid/collections/master.rb
mongoid-1.2.7 lib/mongoid/collections/master.rb
mongoid-pre-2.0.0.pre lib/mongoid/collections/master.rb
mongoid-1.2.6 lib/mongoid/collections/master.rb
mongoid-1.2.5 lib/mongoid/collections/master.rb
mongoid-1.2.4 lib/mongoid/collections/master.rb
mongoid-1.2.3 lib/mongoid/collections/master.rb
mongoid-1.2.2 lib/mongoid/collections/master.rb
mongoid-1.2.1 lib/mongoid/collections/master.rb
mongoid-1.2.0 lib/mongoid/collections/master.rb