diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb index e7bdab58c6..2ce6b3cbd8 100644 --- a/activerecord/test/cases/scoping/default_scoping_test.rb +++ b/activerecord/test/cases/scoping/default_scoping_test.rb @@ -523,13 +523,8 @@ class DefaultScopingTest < ActiveRecord::TestCase end def test_with_abstract_class_scope_should_be_executed_in_correct_context - vegetarian_pattern, gender_pattern = if current_adapter?(:Mysql2Adapter) - [/`lions`.`is_vegetarian`/, /`lions`.`gender`/] - elsif current_adapter?(:OracleAdapter) - [/"LIONS"."IS_VEGETARIAN"/, /"LIONS"."GENDER"/] - else - [/"lions"."is_vegetarian"/, /"lions"."gender"/] - end + vegetarian_pattern = /#{Regexp.escape(Lion.connection.quote_table_name("lions.is_vegetarian"))}/i + gender_pattern = /#{Regexp.escape(Lion.connection.quote_table_name("lions.gender"))}/i assert_match vegetarian_pattern, Lion.all.to_sql assert_match gender_pattern, Lion.female.to_sql