class Libis::Ingester::API::Validator::UserId

Public Instance Methods

validate_param!(attr_name, params) click to toggle source
# File lib/libis/ingester/server/api/validator/user_id.rb, line 6
def validate_param!(attr_name, params)
  unless Libis::Ingester::User.find_by(id: params[attr_name])
    fail Grape::Exceptions::Validation,
         params: [@scope.full_name(attr_name)],
         message: "'#{params[attr_name]}': user could not be found."
  end
end