aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-12-02 14:38:05 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-12-02 14:38:05 -0200
commit4baa9c45f613dbee4f7b36383a1f1b4fc3e372af (patch)
tree52c7a0fb950df8c4491cd63949db8f0daa473c78 /activerecord/test/cases
parentf09ecb0d45b02ce13375e15660fe7b4af8d59e87 (diff)
parent66b84c9f442b6d25040a306416c4a863a2dfb397 (diff)
downloadrails-4baa9c45f613dbee4f7b36383a1f1b4fc3e372af.tar.gz
rails-4baa9c45f613dbee4f7b36383a1f1b4fc3e372af.tar.bz2
rails-4baa9c45f613dbee4f7b36383a1f1b4fc3e372af.zip
Merge pull request #17881 from deeeki/unscope_arel_where
Allow to unscope where conditions by arel_table with symbol
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/scoping/default_scoping_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb
index 5bdebe6ac7..0738df1b54 100644
--- a/activerecord/test/cases/scoping/default_scoping_test.rb
+++ b/activerecord/test/cases/scoping/default_scoping_test.rb
@@ -143,6 +143,14 @@ class DefaultScopingTest < ActiveRecord::TestCase
expected_5 = Developer.order('salary DESC').collect(&:name)
received_5 = DeveloperOrderedBySalary.where.not("name" => ["Jamis", "David"]).unscope(where: :name).collect(&:name)
assert_equal expected_5, received_5
+
+ expected_6 = Developer.order('salary DESC').collect(&:name)
+ received_6 = DeveloperOrderedBySalary.where(Developer.arel_table['name'].eq('David')).unscope(where: :name).collect(&:name)
+ assert_equal expected_6, received_6
+
+ expected_7 = Developer.order('salary DESC').collect(&:name)
+ received_7 = DeveloperOrderedBySalary.where(Developer.arel_table[:name].eq('David')).unscope(where: :name).collect(&:name)
+ assert_equal expected_7, received_7
end
def test_unscope_multiple_where_clauses