Pārlūkot izejas kodu

Use uniq for smart variables

Andrew Kane 9 gadi atpakaļ
vecāks
revīzija
db8f2dc2c4
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      app/controllers/blazer/dashboards_controller.rb

+ 1 - 1
app/controllers/blazer/dashboards_controller.rb

@@ -35,7 +35,7 @@ module Blazer
           query = data_source.smart_variables[var]
           if query
             rows, error, cached_at = data_source.run_statement(query)
-            (@smart_vars[var] ||= []).concat rows.map { |v| v.values.reverse }
+            ((@smart_vars[var] ||= []).concat(rows.map { |v| v.values.reverse })).uniq!
             @sql_errors << error if error
           end
         end