Files
openfoodnetwork/app/helpers/admin/enterprises_helper.rb
2021-10-05 21:35:18 +02:00

18 lines
300 B
Ruby

# frozen_string_literal: true
module Admin
module EnterprisesHelper
def add_check_if_single(count)
if count == 1
{ checked: true }
else
{}
end
end
def select_only_item(producers)
producers.size == 1 ? producers.first.id : nil
end
end
end