Files
nairobi/app/helpers/valuation_helper.rb
Javi Martín eafb4018bf Apply Style/CollectionMethods rubocop rule
We were already using `map` and `reduce` almost everywhere.
2019-10-26 13:03:49 +02:00

19 lines
561 B
Ruby

module ValuationHelper
def valuator_or_group_select_options
valuator_group_select_options + valuator_select_options
end
def valuator_select_options
Valuator.order("description ASC").order("users.email ASC").includes(:user).
map { |v| [v.description_or_email, "valuator_#{v.id}"] }
end
def valuator_group_select_options
ValuatorGroup.order("name ASC").map { |g| [g.name, "group_#{g.id}"] }
end
def explanation_field(field)
simple_format_no_tags_no_sanitize(sanitize_and_auto_link(field)) if field.present?
end
end