On Thu, Oct 8, 2015 at 10:39 AM, Jedrin <
jrub...@gmail.com> wrote:
> I have a helper like this:
>
> def table_elements(qualifier, count)
> if qualifier
> yield
> else
> return ("<td></td>" * count).html_safe
> end
> end
Try a NullObject. That is, supposing qualifier is of type Client,
have a class NullClient where remittance_id and availability_date are
nil. Make your data include NullClients instead of any nils. If I
remember rightly, a couple years ago Avdi Grimm put out a gem that
does a lot of the boilerplate in applying the Null Object pattern.
-Dave
--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com,
Blog.Codosaur.us, and Dare2XL.com.