OfficeMomsandDads/scheduler

View on GitHub
app/helpers/needs_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module NeedsHelper
  def race_options_for_select
    Race.pluck(:name, :id)
  end

  def language_options_for_select
    language_options = Language.all.map { |l| [l.name, l.id] }
    english = language_options.find { |l| l[0] == 'English' }
    options_for_select(language_options, selected: english[1])
  end
end