Added ban information to user api

This commit is contained in:
Chris Blanchard 2015-08-01 16:44:39 +01:00
parent a3356e57d3
commit f9f4485c95
3 changed files with 51 additions and 19 deletions

View file

@ -17,6 +17,11 @@ class Api::V1::UsersController < Api::V1::BaseController
steam: {
url: @steam.base_url,
nickname: @steam.nickname
},
bans: {
gather: @user.banned?(Ban::TYPE_GATHER).present?,
mute: @user.banned?(Ban::TYPE_MUTE).present?,
site: @user.banned?(Ban::TYPE_SITE).present?
}
}
rescue ActiveRecord::RecordNotFound