metamaps--metamaps/app/controllers/api/v2/users_controller.rb

25 lines
515 B
Ruby
Raw Normal View History

2016-10-04 14:24:47 +00:00
# frozen_string_literal: true
module Api
module V2
class UsersController < RestfulController
def current
@user = current_user
authorize @user
show # delegate to the normal show function
2016-10-04 14:24:47 +00:00
end
2016-10-04 14:24:47 +00:00
private
def searchable_columns
[:name]
end
# only ask serializer to return is_admin field if we're on the
# current_user action
def default_scope
super.merge(show_full_user: action_name == 'current')
2016-10-04 14:24:47 +00:00
end
end
end
end