Display value when raising due to unscope() issues

Hopefully make it easier to debug errors. e.g

Before:

    RuntimeError:
       unscope(where: "deleted_at") failed: unscoping String is unimplemented.

After:

    RuntimeError:
       unscope(where: "deleted_at") failed: unscoping String "'t'='t'" is unimplemented.
This commit is contained in:
Washington Luiz 2014-01-27 02:18:56 -03:00
parent dd339bb0ad
commit 8b14b11434

@ -877,7 +877,7 @@ def where_unscoping(target_value)
subrelation = (rel.left.kind_of?(Arel::Attributes::Attribute) ? rel.left : rel.right)
subrelation.name == target_value
else
raise "unscope(where: #{target_value.inspect}) failed: unscoping #{rel.class} is unimplemented."
raise "unscope(where: #{target_value.inspect}) failed: unscoping #{rel.class} \"#{rel}\" is unimplemented."
end
end