app/helpers/agilibox/text_helper.rb in agilibox-1.0.15 vs app/helpers/agilibox/text_helper.rb in agilibox-1.1.0

- old
+ new

@@ -37,12 +37,20 @@ opts[:separator] = I18n.t("number.format.separator") number_with_precision(n, opts).tr(" ", "\u00A0") end - def date(d) - return if d.nil? - I18n.l(d) + def date(d, *args) + I18n.l(d, *args) unless d.nil? + end + + def boolean_icon(bool) + return if bool.nil? + + return icon(:check, style: "color: green") if bool == true + return icon(:times, style: "color: red") if bool == false + + raise "#{bool} is not a boolean" end def hours(n) return if n.nil?