aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorBen Toews <mastahyeti@gmail.com>2017-08-11 09:55:54 -0600
committerMatthew Draper <matthew@trebex.net>2017-11-09 22:37:23 +1030
commit0d8626ad3f1bac3b814d554147ff7926c0380fad (patch)
tree9b490ba29c874e79eed64f83234248c4c8f1ca42 /activerecord/lib
parent310c3a8f2d043f3d00d3f703052a1e160430a2c2 (diff)
downloadrails-0d8626ad3f1bac3b814d554147ff7926c0380fad.tar.gz
rails-0d8626ad3f1bac3b814d554147ff7926c0380fad.tar.bz2
rails-0d8626ad3f1bac3b814d554147ff7926c0380fad.zip
remove :enabled option
Diffstat (limited to 'activerecord/lib')
-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: