Skip to content

Commit

Permalink
Added class name and ID for ImpossibleMove exception msg
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroFernandesAntunes committed Jul 27, 2023
1 parent da27054 commit 6530925
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/awesome_nested_set/move.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6530925

Please sign in to comment.