From eac74277557752f1584fe9ff658b2885ccd30421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 28 Sep 2019 20:43:39 +0200 Subject: [PATCH] Remove line auto-assigning a variable to `nil` This is one of the most strange behaviours in ruby: if a variable doesn't exist, assigning to itself will return `nil`. So a line like: mdmkdfm = ooops if mdmkdfm.respond_to?(:uiqpior) Surprisingly will not raise any errors: the nonexistent `mdmkdfm` variable will be evaluated to `nil`, `mdmkdfm.respond_to?(:uiqpior)` will evaluate to `nil.respond_to?(:uiqpior)`, which will return `false`, and then the line will be evaluated as `mdmkdfm = ooops if false`, which will return `nil`. Maybe in the future Ruby will change this behaviour. We hope CONSUL is now in better shape if that ever happens :). --- app/helpers/stats_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/helpers/stats_helper.rb b/app/helpers/stats_helper.rb index d321bce0b..fe0786738 100644 --- a/app/helpers/stats_helper.rb +++ b/app/helpers/stats_helper.rb @@ -25,7 +25,6 @@ module StatsHelper end def budget_investments_chart_tag(opt = {}) - events = events.join(",") if events.is_a? Array opt[:data] ||= {} opt[:data][:graph] = admin_api_stats_path(budget_investments: true) content_tag :div, "", opt