Sha256: 406cd98a07eafedfafed3a4050d17b41a90953f4efe93f74c6de16b3fbf730a9
Contents?: true
Size: 597 Bytes
Versions: 30
Compression:
Stored size: 597 Bytes
Contents
module Scrivito class UsersController < WebserviceController def mget @users = Scrivito::User.mget(*params[:ids]) add_current_user_if_missing(params[:ids], @users) render :users end def suggest @users = scrivito_user.suggest_users(params[:input]).first(20) render :users end private def add_current_user_if_missing(ids, users) index_of_current_user = ids.index(scrivito_user.id) if index_of_current_user && users[index_of_current_user].blank? users[index_of_current_user] = scrivito_user end end end end
Version data entries
30 entries across 30 versions & 1 rubygems