diff options
author | Abhay Nikam <nikam.abhay1@gmail.com> | 2019-03-03 19:09:45 +0530 |
---|---|---|
committer | Abhay Nikam <nikam.abhay1@gmail.com> | 2019-03-03 22:25:10 +0530 |
commit | 82b0ff03b1d97c29472a65ef15103932d15ff75e (patch) | |
tree | 12887d6150b67e1a1fa63d9311412785dc21bff1 /activerecord/test/cases/relation | |
parent | e33c1f3c26ff3d2921d953d5c747cb5b90c6c1c6 (diff) | |
download | rails-82b0ff03b1d97c29472a65ef15103932d15ff75e.tar.gz rails-82b0ff03b1d97c29472a65ef15103932d15ff75e.tar.bz2 rails-82b0ff03b1d97c29472a65ef15103932d15ff75e.zip |
Fixed reselect throwing NoMethodError on ActiveRecord.
Diffstat (limited to 'activerecord/test/cases/relation')
-rw-r--r-- | activerecord/test/cases/relation/delegation_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/relation/select_test.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb index 4de3b1300c..31e7a4b8f4 100644 --- a/activerecord/test/cases/relation/delegation_test.rb +++ b/activerecord/test/cases/relation/delegation_test.rb @@ -56,7 +56,7 @@ module ActiveRecord :where, :rewhere, :preload, :eager_load, :includes, :from, :lock, :readonly, :extending, :having, :create_with, :distinct, :references, :none, :unscope, :merge, :count, :average, :minimum, :maximum, :sum, :calculate, - :pluck, :pick, :ids, + :pluck, :pick, :ids, :reselect, ] def test_delegate_querying_methods diff --git a/activerecord/test/cases/relation/select_test.rb b/activerecord/test/cases/relation/select_test.rb index 32e8f473ff..586aaadd0a 100644 --- a/activerecord/test/cases/relation/select_test.rb +++ b/activerecord/test/cases/relation/select_test.rb @@ -16,5 +16,12 @@ module ActiveRecord expected = Post.select(:title).to_sql assert_equal expected, Post.select(:title, :body).reselect(:title).to_sql end + + def test_reselect_with_default_scope_select + expected = Post.select(:title).to_sql + actual = PostWithDefaultSelect.reselect(:title).to_sql + + assert_equal expected, actual + end end end |