From b4b6c7326517f4bde526f9e9a3f689510ca62bbf Mon Sep 17 00:00:00 2001 From: Nick Carboni Date: Fri, 5 Jan 2018 17:19:16 -0500 Subject: [PATCH] Appease brakeman with many s --- app/models/mixins/purging_mixin.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/mixins/purging_mixin.rb b/app/models/mixins/purging_mixin.rb index a9420db42af..284e96fede3 100644 --- a/app/models/mixins/purging_mixin.rb +++ b/app/models/mixins/purging_mixin.rb @@ -113,7 +113,8 @@ def purge_polymorphic_orphans(fk_name, window) polymorphic_classes(type_column).each do |klass| resource_table = connection.quote_table_name(klass.table_name) scope = joins("LEFT OUTER JOIN #{resource_table} ON #{table_name}.resource_id = #{resource_table}.id") - .where(resource_table => {:id => nil}, type_column => klass.name) + .where(resource_table => {:id => nil}) + .where("#{table_name}.#{connection.quote_column_name(type_column)} = #{connection.quote(klass.name)}") total += purge_in_batches(scope, window) end total