module ValuatorsHelper
  def valuator_label(valuator)
    truncate([valuator.name, valuator.email, valuator.description].compact.join(" - "), length: 100)
  end

  def valuator_abilities(valuator)
    [valuator.can_comment ? I18n.t("admin.valuators.index.can_comment") : nil,
      valuator.can_edit_dossier ? I18n.t("admin.valuators.index.can_edit_dossier") : nil
    ].compact.join(", ")
  end
end

module ValuatorsHelper
  def valuator_label(valuator)
    truncate([valuator.name, valuator.email, valuator.description].compact.join(" - "), length: 100)
  end

  def valuator_abilities(valuator)
    %w[can_comment can_edit_dossier]
      .select { |permission| valuator.send("#{permission}?") }
      .map    { |permission| I18n.t("admin.valuators.index.#{permission}") }
      .join(", ")
  end
end

Refactor method to display valuator abilities
Refactor method to display valuator abilities

Using `select` is easier to follow than adding `nil` to an array and
then using `compact`.
