From 65309252690a4093bb0de20535af8d9e9049f696 Mon Sep 17 00:00:00 2001 From: AlejandroFernandesAntunes Date: Thu, 27 Jul 2023 12:20:01 -0300 Subject: [PATCH] Added class name and ID for ImpossibleMove exception msg --- lib/awesome_nested_set/move.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/awesome_nested_set/move.rb b/lib/awesome_nested_set/move.rb index 01d783bf..ccf674b9 100644 --- a/lib/awesome_nested_set/move.rb +++ b/lib/awesome_nested_set/move.rb @@ -129,7 +129,9 @@ class ImpossibleMove < ActiveRecord::StatementInvalid def prevent_impossible_move if !root && !instance.move_possible?(target) - raise ImpossibleMove, "Impossible move, target node cannot be inside moved tree." + error_msg = "Impossible move, target node (#{target.class.name},ID: #{target.id}) + cannot be inside moved tree (#{instance.class.name},ID: #{instance.id})." + raise ImpossibleMove, error_msg end end