From 40d302d880f247ef9547708b1d26a390945b6fe9 Mon Sep 17 00:00:00 2001 From: Ben Toews Date: Mon, 25 Sep 2017 10:54:53 -0600 Subject: always allow Arel::Attributes::Attribute also --- activerecord/lib/active_record/attribute_methods.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 5ce3ba7a63..ff381b4e0b 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -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? -- cgit v1.2.3