Fixed bug where passed a nil value to Row#cell would be treated as though
there was no second value
Fixed bug where passed a nil value to Row#cell would be treated
as though there was no second value
This pull request passes (merged cd70ded into 13b138b).
Hey just had a thought, would this not still fail if the model has a column (say building_name) but we're also calculating that manually, and that calculation returns nil. This would mistakenly return the model's building_name instead of an empty string.
@brendon I'm not going to take this issue any further.
The main use case for CSV Shaper is working with models. If you want to add cells manually you can create a row without a model using
csv.row do |csv|
# no model issues here
Thanks you your help.
Hi Paul, in my case I'm wanting to include columns from an associated model (sometimes the associated models column evaluates to nil). I guess provided I make sure that I don't chose a column name that matches an existing method on the model then all will be well :) I still think that using a block to calculate a manual cell value is more explicit and has less confusing edge cases. Though this would break backward compatibility.