mongoid/mongoid

View on GitHub
lib/mongoid/errors/too_many_nested_attribute_records.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Mongoid
  module Errors

    # This error is raised when trying to create set nested records above the
    # specified :limit
    #
    # @example Create the error.
    #   TooManyNestedAttributeRecords.new('association', limit)
    class TooManyNestedAttributeRecords < MongoidError
      def initialize(association, limit)
        super(
          compose_message(
            "too_many_nested_attribute_records",
            { association: association, limit: limit }
          )
        )
      end
    end
  end
end