#select_charts
  - @groups.each_pair do |group, charts|
    %h1= t("chart_group.#{group.downcase}")
    - if charts.is_a?(Array)
      = render 'chart_preview', charts: charts

    - elsif charts.is_a?(Hash)
      - charts.each_pair do |sub_group, charts|
        - if sub_group
          %h2= t("chart_sub_group.#{sub_group.downcase}")
        = render 'chart_preview', charts: charts

#select_charts
  - @groups.each_pair do |group, charts|
    %h1= t("chart_group.#{group.downcase}")
    - if charts.is_a?(Array)
      = render 'chart_preview', charts: charts

    - elsif charts.is_a?(Hash)
      - charts.each_pair do |sub_group, charts|
        - if sub_group.present?
          %h2= t("chart_sub_group.#{sub_group.downcase}")
        = render 'chart_preview', charts: charts

Check for presence of subgroup instead of NOT NULL
Check for presence of subgroup instead of NOT NULL
