File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,6 @@ def test_column_names_are_escaped_coerced
8585 assert_equal '[t]]]' , conn . quote_column_name ( 't]' )
8686 end
8787
88-
89-
9088 # Just like PostgreSQLAdapter does.
9189 coerce_tests! :test_respect_internal_encoding
9290
@@ -115,6 +113,16 @@ def test_update_date_time_attributes_with_default_timezone_local
115113 end
116114 end
117115 end
116+
117+ # Need to escape `quoted_id` once it contains brackets
118+ coerce_tests! %r{column names are quoted when using #from clause and model has ignored columns}
119+ test "column names are quoted when using #from clause and model has ignored columns coerced" do
120+ refute_empty Developer . ignored_columns
121+ query = Developer . from ( "developers" ) . to_sql
122+ quoted_id = "#{ Developer . quoted_table_name } .#{ Developer . quoted_primary_key } "
123+
124+ assert_match ( /SELECT #{ Regexp . escape ( quoted_id ) } .* FROM developers/ , query )
125+ end
118126end
119127
120128
You can’t perform that action at this time.
0 commit comments