Sha256: 9b6a562fe05bf2cbb53166b99c2de897c6f5b6b3ec9a536fb9aed5a6ad7cd9f4
Contents?: true
Size: 507 Bytes
Versions: 54
Compression:
Stored size: 507 Bytes
Contents
# frozen_string_literal: true module Motor class UsersForAutocompleteController < ApiBaseController def index authorize!(:create, Motor::Note) render json: { data: user_emails } end private def user_emails user_class = Motor::AdminUser if defined?(Motor::AdminUser) user_class ||= AdminUser if defined?(AdminUser) user_class ||= User if defined?(User) return user_class.distinct.limit(100).pluck(:email) if user_class [] end end end
Version data entries
54 entries across 54 versions & 6 rubygems