aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb2
-rw-r--r--activerecord/lib/active_record/core.rb5
2 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index e167c4ad6f..5ce3ba7a63 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -168,8 +168,6 @@ module ActiveRecord
end
def enforce_raw_sql_whitelist(args, whitelist: attribute_names_and_aliases) # :nodoc:
- return if allow_unsafe_raw_sql == :enabled
-
unexpected = args.reject do |arg|
whitelist.include?(arg.to_s) ||
arg.kind_of?(Arel::Node) || arg.is_a?(Arel::Nodes::SqlLiteral)
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index b1e3f71dfe..b97b14644e 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -78,12 +78,11 @@ module ActiveRecord
# :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
+ # UnknownAttributeReference exception.
+ mattr_accessor :allow_unsafe_raw_sql, instance_writer: false, default: :deprecated
##
# :singleton-method: