Sha256: 5e1d7a4ff5ac4735fb264fabcadcc3b9dbb725ef7ffff607d5d3e137b42095c9

Contents?: true

Size: 794 Bytes

Versions: 96

Compression:

Stored size: 794 Bytes

Contents

# encoding: utf-8
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
    #
    # @since 2.0.0
    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

96 entries across 91 versions & 7 rubygems

Version Path
mongoid-3.1.7 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.2 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.1 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0.rc2 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0.rc1 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0.beta2 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0.beta1 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0.alpha2 lib/mongoid/errors/mixed_relations.rb
mongoid-4.0.0.alpha1 lib/mongoid/errors/mixed_relations.rb
mongoid-3.1.6 lib/mongoid/errors/mixed_relations.rb
sepastian-mongoid-rails4-4.0.1.alpha lib/mongoid/errors/mixed_relations.rb
sepastian-mongoid-rails4-4.0.0.alpha lib/mongoid/errors/mixed_relations.rb
mongoid-3.1.5 lib/mongoid/errors/mixed_relations.rb
mongoid_heroku_stable-4.0.0 lib/mongoid/errors/mixed_relations.rb
mongoid_rails4-4.0.0 lib/mongoid/errors/mixed_relations.rb
mongoid-3.1.4 lib/mongoid/errors/mixed_relations.rb
mongoid-3.1.3 lib/mongoid/errors/mixed_relations.rb
mongoid-3.1.2 lib/mongoid/errors/mixed_relations.rb
mongoid-3.0.23 lib/mongoid/errors/mixed_relations.rb