aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
authorKevin Deisz <kevin.deisz@gmail.com>2018-08-24 16:10:17 -0400
committerKevin Deisz <kevin.deisz@gmail.com>2018-08-24 16:10:17 -0400
commitc14859513a648270705b61210dc3ab2fe5d04004 (patch)
treedf253cd04ba9ffb7f4797eebe4af1031d1b0f5cc /activerecord/lib/active_record/attribute_methods.rb
parente2d8a2ccfd3b0d2030920346a2ff0cad93fcb188 (diff)
downloadrails-c14859513a648270705b61210dc3ab2fe5d04004.tar.gz
rails-c14859513a648270705b61210dc3ab2fe5d04004.tar.bz2
rails-c14859513a648270705b61210dc3ab2fe5d04004.zip
Convert over the rest of the whitelist references
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index e4b8b1a330..85591efd36 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -167,12 +167,12 @@ module ActiveRecord
end
end
- # Regexp whitelist. Matches the following:
+ # Regexp permitted list. Matches the following:
# "#{table_name}.#{column_name}"
# "#{column_name}"
- COLUMN_NAME_WHITELIST = /\A(?:\w+\.)?\w+\z/i
+ COLUMN_NAME_PERMIT_LIST = /\A(?:\w+\.)?\w+\z/i
- # Regexp whitelist. Matches the following:
+ # Regexp permitted list. Matches the following:
# "#{table_name}.#{column_name}"
# "#{table_name}.#{column_name} #{direction}"
# "#{table_name}.#{column_name} #{direction} NULLS FIRST"
@@ -181,7 +181,7 @@ module ActiveRecord
# "#{column_name} #{direction}"
# "#{column_name} #{direction} NULLS FIRST"
# "#{column_name} NULLS LAST"
- COLUMN_NAME_ORDER_WHITELIST = /
+ COLUMN_NAME_ORDER_PERMIT_LIST = /
\A
(?:\w+\.)?
\w+
@@ -190,12 +190,12 @@ module ActiveRecord
\z
/ix
- def enforce_raw_sql_whitelist(args, whitelist: COLUMN_NAME_WHITELIST) # :nodoc:
+ def enforce_raw_sql_permit_list(args, permit_list: COLUMN_NAME_PERMIT_LIST) # :nodoc:
unexpected = args.reject do |arg|
arg.kind_of?(Arel::Node) ||
arg.is_a?(Arel::Nodes::SqlLiteral) ||
arg.is_a?(Arel::Attributes::Attribute) ||
- arg.to_s.split(/\s*,\s*/).all? { |part| whitelist.match?(part) }
+ arg.to_s.split(/\s*,\s*/).all? { |part| permit_list.match?(part) }
end
return if unexpected.none?