aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/unsafe_raw_sql_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow column name with function (e.g. `length(title)`) as safe SQL stringRyuta Kamizono2019-06-101-27/+28
| | | | | | | | | | | | | | | | Currently, almost all "Dangerous query method" warnings are false alarm. As long as almost all the warnings are false alarm, developers think "Let's ignore the warnings by using `Arel.sql()`, it actually is false alarm in practice.", so I think we should effort to reduce false alarm in order to make the warnings valuable. This allows column name with function (e.g. `length(title)`) as safe SQL string, which is very common false alarm pattern, even in the our codebase. Related 6c82b6c99, 6607ecb2a, #36420. Fixes #32995.
* Allow `column_name AS alias` as safe SQL stringRyuta Kamizono2019-06-101-0/+10
|
* Allow quoted identifier string as safe SQL stringRyuta Kamizono2019-06-061-4/+26
| | | | | | | | | | | | | Currently `posts.title` is regarded as a safe SQL string, but `"posts"."title"` (it is a result of `quote_table_name("posts.title")`) is regarded as an unsafe SQL string even though a result of `quote_table_name` should obviously be regarded as a safe SQL string, since the column name matcher doesn't respect quotation, it is a little annoying. This changes the column name matcher to allow quoted identifiers as safe SQL string, now all results of the `quote_table_name` are regarded as safe SQL string.
* whitelist NULLS { FIRST | LAST } in order clausesXavier Noria2018-03-061-0/+20
|
* Merge pull request #27947 from mastahyeti/unsafe_raw_sqlMatthew Draper2017-11-141-16/+12
| | | | Disallow raw SQL in dangerous AR methods
* use database agnostic function/quoting in testBen Toews2017-11-091-4/+4
|
* push order arg checks down to allow for bindsBen Toews2017-11-091-0/+36
|
* try using regexesBen Toews2017-11-091-2/+2
|
* allow table name and direction in string order argBen Toews2017-11-091-1/+41
|
* remove :enabled optionBen Toews2017-11-091-54/+50
|
* make tests more verbose/explicitBen Toews2017-11-091-78/+96
|
* allow Arel.sql() for pluckBen Toews2017-11-091-17/+53
|
* add config to check arguments to unsafe AR methodsBen Toews2017-11-091-0/+177