fix color css rendering on non existing color

For instances already/still having entries (priorities, status, ...) with color_id = 0, we need to check explicitly if the color exists
This commit is contained in:
Jens Ulferts
2018-09-17 10:22:29 +02:00
parent 589b3fdfcb
commit e9f854fa7c
+3 -2
View File
@@ -1,12 +1,13 @@
<%
colored_resource = Proc.new do |name, scope|
scope.includes(:color).find_each do |entry|
if entry.color_id.nil?
color = entry.color
if color.nil?
concat ".__hl_dot_#{name}_#{entry.id}::before { display: none }\n"
next
end
color = entry.color
styles = color.color_styles
inline_style = styles.map{|k,v| "#{k}:#{v} !important"}.join(';')