lib/tabulatr/renderer/column.rb in tabulatr2-0.8.0 vs lib/tabulatr/renderer/column.rb in tabulatr2-0.8.1
- old
+ new
@@ -85,11 +85,11 @@
if block
return view.instance_exec(record, &block)
end
val = principal_value(record) or return ''
- if format.present? && val.respond_to?(:to_a)
+ if format.present? && val.respond_to?(:to_ary)
val.map do |v|
case format
when Symbol then view.send(format, v)
when String then format % v
when Proc then format.(v)
@@ -101,9 +101,11 @@
when Symbol then view.send(format, val)
when String then format % val
when Proc then format.(val)
else val
end
+ else
+ val
end
end
def principal_value(record)
record.send name