Skip to content

A platform for community discussion. Free, open, simple.

minor refactoring (#6615)

Joffrey JAFFEUX078705bcc04e
diff --git a/app/models/report.rb b/app/models/report.rb
index 0c894769a0d..cf02c70170b 100644
--- a/app/models/report.rb
+++ b/app/models/report.rb
@@ -1325,12 +1325,12 @@ class Report
end
def rgba_color(hex, opacity = 1)
- if hex.length === 3
+ if hex.size == 3
chars = hex.scan(/\w/)
- hex = chars.zip(chars).flatten.join.ljust(6)
+ hex = chars.zip(chars).flatten.join
end
- if hex.length < 3
+ if hex.size < 3
hex = hex.ljust(6, hex.last)
end