Fixed syntax error.
This commit is contained in:
parent
480abed922
commit
84e98e4b2c
1 changed files with 8 additions and 8 deletions
|
@ -6,14 +6,14 @@ class UsersController < ApplicationController
|
||||||
@users = User.all
|
@users = User.all
|
||||||
@users_all = []
|
@users_all = []
|
||||||
@users.each {|user|
|
@users.each {|user|
|
||||||
@users_all.push user_data_full( user.id )
|
@users_all.push User.user_data_full( user.id )
|
||||||
}
|
}
|
||||||
render :json => @users_all
|
render :json => @users_all
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /users/1
|
# GET /users/1
|
||||||
def show
|
def show
|
||||||
@user = user_data_full( params[:id] )
|
@user = User.user_data_full( params[:id] )
|
||||||
render :json => @user
|
render :json => @user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# if it's a signup, add user to customer role
|
# if it's a signup, add user to customer role
|
||||||
if @user.created_by_id == 1
|
if @user.created_by_id == 1
|
||||||
|
|
||||||
# check if it's first user
|
# check if it's first user
|
||||||
count = User.all.count()
|
count = User.all.count()
|
||||||
group_ids = []
|
group_ids = []
|
||||||
|
@ -39,7 +39,7 @@ class UsersController < ApplicationController
|
||||||
Group.all().each { |group|
|
Group.all().each { |group|
|
||||||
group_ids.push group.id
|
group_ids.push group.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# everybody else will go as customer per default
|
# everybody else will go as customer per default
|
||||||
else
|
else
|
||||||
role_ids.push Role.where( :name => 'Customer' ).first.id
|
role_ids.push Role.where( :name => 'Customer' ).first.id
|
||||||
|
@ -56,10 +56,10 @@ class UsersController < ApplicationController
|
||||||
@user.group_ids = params[:group_ids]
|
@user.group_ids = params[:group_ids]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# send inviteation if needed
|
# send inviteation if needed
|
||||||
if params[:invite]
|
if params[:invite]
|
||||||
|
|
||||||
# logger.debug('IIIIIIIIIIIIIIIIIIIIIIIIIIIIII')
|
# logger.debug('IIIIIIIIIIIIIIIIIIIIIIIIIIIIII')
|
||||||
# exit '123'
|
# exit '123'
|
||||||
end
|
end
|
||||||
|
@ -83,8 +83,8 @@ class UsersController < ApplicationController
|
||||||
if params[:organization_ids]
|
if params[:organization_ids]
|
||||||
@user.organization_ids = params[:organization_ids]
|
@user.organization_ids = params[:organization_ids]
|
||||||
end
|
end
|
||||||
|
|
||||||
@user = user_data_full( params[:id] )
|
@user = User.user_data_full( params[:id] )
|
||||||
render :json => @user, :status => :ok
|
render :json => @user, :status => :ok
|
||||||
else
|
else
|
||||||
render :json => @user.errors, :status => :unprocessable_entity
|
render :json => @user.errors, :status => :unprocessable_entity
|
||||||
|
|
Loading…
Reference in a new issue