Skip to content

Commit

Permalink
Merge 6653e59 into 79d9797
Browse files Browse the repository at this point in the history
  • Loading branch information
chargio committed Feb 13, 2018
2 parents 79d9797 + 6653e59 commit 00cc788
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 0 additions & 7 deletions app/controllers/v1/api_controller/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ class ApiController
# Metadata request module
#
##
=begin
@apiDefine Pagination Pagination
@apiSuccess {Object} meta Metadata
@apiSuccess {Integer} meta.current_page Current page in pagination
@apiSuccess {Integer} meta.total_pages Total number of pages
@apiSuccess {Integer} meta.total_count Total number of elements
=end
module Metadata
# Generate metadata information for request.
#
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/v1/api_controller/pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ class ApiController
# Pagination request module
#
##
=begin
@apiDefine Pagination Pagination
@apiSuccess {Object} meta Meta
@apiSuccess {Integer} meta.pagination.current_page Current page in pagination
@apiSuccess {Integer} meta.pagination.total_pages Total number of pages
@apiSuccess {Integer} meta.pagination.total_count Total number of elements
@apiVersion 1.0.0
=end
module Pagination
# Get the specific page collection with limit option.
#
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def index
@apiError (No Content 404) {String} UserNotFound.title Error title
@apiError (No Content 404) {String} UserNotFound.Detail Additional detail on error
@apiError (No Content 404) {Object} UserNotFound.extra
@apiError (No Content 404) {String} UserNotFound.extra.username User ID
@apiError (No Content 404) {String} UserNotFound.extra.username User ID requested
@apiErrorExample {json} User not found
{
Expand All @@ -101,7 +101,7 @@ def index
def show
return unless check_params_required(:id)
logger.debug "Looking for user with github_login #{params[:id]}"
@user = User.find_by(id: params[:id]) || User.find_by(github_login: params[:id])
@user = User.find_by('id= ? OR github_login= ?', params[:id], params[:id])
if @user
return_response @user, :ok
else
Expand Down

0 comments on commit 00cc788

Please sign in to comment.