Sha256: ab49018158242028d32826e30233d530ab1baa2bc3ad31ee53c4ebaa6fcf793f

Contents?: true

Size: 782 Bytes

Versions: 25

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

module Mongoid
  module Errors

    # This error is raised when trying to reference an embedded document from
    # a document in another collection that is not its parent.
    #
    # @example An illegal reference to an embedded document.
    #   class Post
    #     include Mongoid::Document
    #     references_many :addresses
    #   end
    #
    #   class Address
    #     include Mongoid::Document
    #     embedded_in :person
    #     referenced_in :post
    #   end
    class MixedRelations < MongoidError
      def initialize(root_klass, embedded_klass)
        super(
          compose_message(
            "mixed_relations",
            { root: root_klass, embedded: embedded_klass }
          )
        )
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mongoid-8.1.8 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.7 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.6 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.8 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.5 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.4 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.7 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.3 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.2 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.6 lib/mongoid/errors/mixed_relations.rb
mongoid-7.5.4 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.1 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.5 lib/mongoid/errors/mixed_relations.rb
mongoid-8.1.0 lib/mongoid/errors/mixed_relations.rb
mongoid-7.5.3 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.4 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.3 lib/mongoid/errors/mixed_relations.rb
mongoid-7.5.2 lib/mongoid/errors/mixed_relations.rb
mongoid-8.0.2 lib/mongoid/errors/mixed_relations.rb
mongoid-7.5.1 lib/mongoid/errors/mixed_relations.rb