Sha256: 40455ed4c2bb62f7928c2919404ca9a87dea0edd830ca2d2d3e7ac0e433ed8ef
Contents?: true
Size: 901 Bytes
Versions: 9
Compression:
Stored size: 901 Bytes
Contents
module OpenStax::Connect::Dev class UsersSearch lev_handler transaction: :no_transaction paramify :search do attribute :search_type, type: String validates :search_type, presence: true, inclusion: { in: %w(Name Username Any), message: "is not valid" } attribute :search_terms, type: String validates :search_terms, presence: true end uses_routine OpenStax::Connect::SearchUsers, as: :search_users, translations: { outputs: {type: :verbatim} } protected def authorized? !Rails.env.production? || caller.is_administrator? end def handle terms = search_params.search_terms type = search_params.search_type run(:search_users, terms, type.downcase.to_sym) end end end
Version data entries
9 entries across 9 versions & 1 rubygems