diff options
author | Washington Luiz <huoxito@gmail.com> | 2014-01-27 02:18:56 -0300 |
---|---|---|
committer | Washington Luiz <huoxito@gmail.com> | 2014-01-27 02:18:56 -0300 |
commit | 8b14b114348c1bf8a88689028e25240d457dff56 (patch) | |
tree | 971ae4cfa7388c2a033e58b74122c7c851191cdf /activerecord/lib/active_record | |
parent | dd339bb0adc3bb1f0c376c4352f769ae2ab02b62 (diff) | |
download | rails-8b14b114348c1bf8a88689028e25240d457dff56.tar.gz rails-8b14b114348c1bf8a88689028e25240d457dff56.tar.bz2 rails-8b14b114348c1bf8a88689028e25240d457dff56.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index d392f759bd..993f628fa3 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -877,7 +877,7 @@ module ActiveRecord 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 |