diff options
author | Matthew Draper <matthew@trebex.net> | 2018-02-11 19:37:10 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-11 19:37:10 +1030 |
commit | a2a752d1026346e3a348682551dfc952f7cf3a58 (patch) | |
tree | 9cf65b124d5c56360346ae7d3b27626c0507aaa6 /activerecord/test/cases/relation | |
parent | d0192e0c2daa03048a8c4d0d3b94763dbbfec4c1 (diff) | |
parent | ccbba229386bdc629be5f5f4ef765ab5e29e7da7 (diff) | |
download | rails-a2a752d1026346e3a348682551dfc952f7cf3a58.tar.gz rails-a2a752d1026346e3a348682551dfc952f7cf3a58.tar.bz2 rails-a2a752d1026346e3a348682551dfc952f7cf3a58.zip |
Merge pull request #31133 from mohsen-alizadeh/sanitize_empty_and_nil_parameters_passed_to_select
sanitize empty and nil parameters to select #31059
Diffstat (limited to 'activerecord/test/cases/relation')
-rw-r--r-- | activerecord/test/cases/relation/select_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation/select_test.rb b/activerecord/test/cases/relation/select_test.rb new file mode 100644 index 0000000000..0577e6bfdb --- /dev/null +++ b/activerecord/test/cases/relation/select_test.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "cases/helper" +require "models/post" + +module ActiveRecord + class SelectTest < ActiveRecord::TestCase + fixtures :posts + + def test_select_with_nil_agrument + expected = Post.select(:title).to_sql + assert_equal expected, Post.select(nil).select(:title).to_sql + end + end +end |