lib/influxer/metrics/relation.rb in influxer-1.1.3 vs lib/influxer/metrics/relation.rb in influxer-1.1.4
- old
+ new
@@ -266,20 +266,18 @@
reset
load
self
end
- # rubocop: disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def quoted(val, key = nil)
if val.is_a?(String) || val.is_a?(Symbol) || @klass.tag?(key)
"'#{val}'"
- elsif val.is_a?(Time) || val.is_a?(Date) || val.is_a?(DateTime)
+ elsif key.to_s == "time"
quote_timestamp val, @instance.client
else
val.to_s
end
end
- # rubocop: enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def get_points(list)
return list if normalized?
list.reduce([]) do |a, e|
a + e.fetch("values", []).map { |v| inject_tags(v, e["tags"] || {}) }