1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

always allow Arel::Attributes::Attribute also

This commit is contained in:
Ben Toews 2017-09-25 10:54:53 -06:00 committed by Matthew Draper
parent 6532802591
commit 40d302d880

View file

@ -170,7 +170,9 @@ module ActiveRecord
def enforce_raw_sql_whitelist(args, whitelist: attribute_names_and_aliases) # :nodoc:
unexpected = args.reject do |arg|
whitelist.include?(arg.to_s) ||
arg.kind_of?(Arel::Node) || arg.is_a?(Arel::Nodes::SqlLiteral)
arg.kind_of?(Arel::Node) ||
arg.is_a?(Arel::Nodes::SqlLiteral) ||
arg.is_a?(Arel::Attributes::Attribute)
end
return if unexpected.none?