Exception: Mongoid::SleepingKingStudios::HasTree::Errors::UnexpectedAncestor

Inherits:
Error
  • Object
show all
Defined in:
lib/mongoid/sleeping_king_studios/has_tree/errors.rb

Overview

class

Since:

  • 0.2.0

Instance Method Summary collapse

Constructor Details

#initialize(relation_name, expected_id, received_id) ⇒ UnexpectedAncestor

Returns a new instance of UnexpectedAncestor

Since:

  • 0.2.0


18
19
20
21
# File 'lib/mongoid/sleeping_king_studios/has_tree/errors.rb', line 18

def initialize relation_name, expected_id, received_id
  message = "expected #{relation_name.to_s.singularize} with id"
  super "#{message} #{expected_id.inspect}, but received id #{received_id.inspect}"
end