diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-02 14:38:05 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-02 14:38:05 -0200 |
commit | 4baa9c45f613dbee4f7b36383a1f1b4fc3e372af (patch) | |
tree | 52c7a0fb950df8c4491cd63949db8f0daa473c78 /activerecord/test/cases | |
parent | f09ecb0d45b02ce13375e15660fe7b4af8d59e87 (diff) | |
parent | 66b84c9f442b6d25040a306416c4a863a2dfb397 (diff) | |
download | rails-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.rb | 8 |
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 |