scinote-web/app/helpers/user_roles_helper.rb

10 lines
241 B
Ruby
Raw Normal View History

2021-04-18 23:19:16 +08:00
# frozen_string_literal: true
module UserRolesHelper
def user_roles_collection
Rails.cache.fetch([current_user, 'available_user_roles']) do
@user_roles_collection ||= UserRole.order(id: :asc).pluck(:name, :id)
2021-04-18 23:19:16 +08:00
end
end
end