diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-02-22 23:22:31 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 23:22:31 +0900 |
commit | 1c36aa71bd352e3704f424991f77c780853b3ac4 (patch) | |
tree | c42ee120c4fe019ed34c3f6003b6707416b33b18 /activerecord/test/cases | |
parent | 0979713abe2e22083e1beca01a1d113408c9ab36 (diff) | |
parent | d53b259a29e77a60a02e9c219661e19ef62ef9aa (diff) | |
download | rails-1c36aa71bd352e3704f424991f77c780853b3ac4.tar.gz rails-1c36aa71bd352e3704f424991f77c780853b3ac4.tar.bz2 rails-1c36aa71bd352e3704f424991f77c780853b3ac4.zip |
Merge pull request #32084 from buehmann/fix/escape-quoted-column-name-in-regexp
Properly escape column name embedded into regexp
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 983a3d366a..7dfb05a6a5 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1501,7 +1501,7 @@ class BasicsTest < ActiveRecord::TestCase query = Developer.from("developers").to_sql quoted_id = "#{Developer.quoted_table_name}.#{Developer.quoted_primary_key}" - assert_match(/SELECT #{quoted_id}.* FROM developers/, query) + assert_match(/SELECT #{Regexp.escape(quoted_id)}.* FROM developers/, query) end test "using table name qualified column names unless having SELECT list explicitly" do |