diff --git a/app/models/image_search.rb b/app/models/image_search.rb index 6a7149cd..71354a48 100644 --- a/app/models/image_search.rb +++ b/app/models/image_search.rb @@ -100,6 +100,12 @@ def raw_sql(dhash) end sql = "SELECT archive_item_id, levenshtein FROM ( #{inner_query} LIMIT 20 ) t ORDER BY levenshtein;" - sql.split("\n").map(&:strip).join(" ") + sql = sql.split("\n").map(&:strip).join(" ") + + if Rails.env.production? && Figaro.AUTH_BASE_HOST == "staging.factcheckinsights.org" + Rails.logger.debug(sql) + end + + sql end end