Commit 5e0c6e56b670295222f3a688408b2b2876d94847

Authored by Spencer Alan
1 parent 0209f73d
Exists in master

remove code duplication in index request

app/controllers/scim_rails/scim_users_controller.rb
@@ -11,25 +11,19 @@ module ScimRails @@ -11,25 +11,19 @@ module ScimRails
11 query.parameter 11 query.parameter
12 ) 12 )
13 .order(ScimRails.config.scim_users_list_order) 13 .order(ScimRails.config.scim_users_list_order)
14 -  
15 - counts = ScimCount.new(  
16 - start_index: params[:startIndex],  
17 - limit: params[:count],  
18 - total: users.count  
19 - )  
20 - json_scim_response(object: users, counts: counts)  
21 else 14 else
22 users = @company 15 users = @company
23 .public_send(ScimRails.config.scim_users_scope) 16 .public_send(ScimRails.config.scim_users_scope)
24 .order(ScimRails.config.scim_users_list_order) 17 .order(ScimRails.config.scim_users_list_order)
25 -  
26 - counts = ScimCount.new(  
27 - start_index: params[:startIndex],  
28 - limit: params[:count],  
29 - total: users.count  
30 - )  
31 - json_scim_response(object: users, counts: counts)  
32 end 18 end
  19 +
  20 + counts = ScimCount.new(
  21 + start_index: params[:startIndex],
  22 + limit: params[:count],
  23 + total: users.count
  24 + )
  25 +
  26 + json_scim_response(object: users, counts: counts)
33 end 27 end
34 28
35 def create 29 def create