solid-adventure / trivial-api

Other
1 stars 1 forks source link

report Title has trailing "and" #281

Open vgkids opened 3 months ago

vgkids commented 3 months ago

A report title can be produced that is Sum by Month and

I believe it's caused by an empty group array and filled group_by_period.

Screenshot 2024-08-20 at 10 22 25 AM

Screenshot 2024-08-20 at 10 22 30 AM

We attempt to account for this, but these checks for values existing aren't covering the empty array edge:

    def generate_title(stat, period_groups, column_groups)
      if period_groups && column_groups
        "#{ stat.titleize } by #{ period_groups.titleize } and #{ array_to_title(column_groups) }"