diff options
author | Ben Toews <mastahyeti@users.noreply.github.com> | 2017-02-08 11:23:26 -0700 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2017-11-09 22:32:16 +1030 |
commit | f989b341eccc6a86fd1ddfff7f1441920855c84e (patch) | |
tree | 9cde6c82ff135be475431e308c1f59b1d57a0cae /activerecord/lib/active_record/core.rb | |
parent | be6e1b8f7dbce1940f47339657faab2c1fdeaa54 (diff) | |
download | rails-f989b341eccc6a86fd1ddfff7f1441920855c84e.tar.gz rails-f989b341eccc6a86fd1ddfff7f1441920855c84e.tar.bz2 rails-f989b341eccc6a86fd1ddfff7f1441920855c84e.zip |
add config to check arguments to unsafe AR methods
Diffstat (limited to 'activerecord/lib/active_record/core.rb')
-rw-r--r-- | activerecord/lib/active_record/core.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 0f7a503c90..b1e3f71dfe 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -76,6 +76,15 @@ module ActiveRecord # scope being ignored is error-worthy, rather than a warning. mattr_accessor :error_on_ignored_order, instance_writer: false, default: false + # :singleton-method: + # Specify the behavior for unsafe raw query methods. Values are as follows + # enabled - Unsafe raw SQL can be passed to query methods. + # deprecated - Warnings are logged when unsafe raw SQL is passed to + # query methods. + # disabled - Unsafe raw SQL passed to query methods results in + # ArguementError. + mattr_accessor :allow_unsafe_raw_sql, instance_writer: false, default: :enabled + ## # :singleton-method: # Specify whether or not to use timestamps for migration versions |