Improve performance of the personal access tokens page.

This commit is contained in:
Timothy Andrew 2016-04-20 14:20:24 +05:30
parent 4e7acd88dc
commit c382bd266d

View file

@ -28,9 +28,9 @@
%hr %hr
%h5= "Active Personal Access Tokens (#{@active_personal_access_tokens.count})" %h5= "Active Personal Access Tokens (#{@active_personal_access_tokens.length})"
- if @active_personal_access_tokens.exists? - if @active_personal_access_tokens.present?
.table-responsive .table-responsive
%table.table.table-striped.table-hover.active-personal-access-tokens %table.table.table-striped.table-hover.active-personal-access-tokens
%thead %thead
@ -41,7 +41,7 @@
%th Expires %th Expires
%th Actions %th Actions
%tbody %tbody
- @active_personal_access_tokens.active.each do |token| - @active_personal_access_tokens.each do |token|
%tr %tr
%td= token.name %td= token.name
%td.input-group.personal-access-tokens-token-column %td.input-group.personal-access-tokens-token-column
@ -62,9 +62,9 @@
%hr %hr
%h5= "Inactive Personal Access Tokens (#{@inactive_personal_access_tokens.count})" %h5= "Inactive Personal Access Tokens (#{@inactive_personal_access_tokens.length})"
- if @inactive_personal_access_tokens.exists? - if @inactive_personal_access_tokens.present?
.table-responsive .table-responsive
%table.table.table-striped.table-hover.inactive-personal-access-tokens %table.table.table-striped.table-hover.inactive-personal-access-tokens
%thead %thead
@ -73,7 +73,7 @@
%th Token %th Token
%th Created %th Created
%tbody %tbody
- @inactive_personal_access_tokens.order("revoked, expires_at").each do |token| - @inactive_personal_access_tokens.each do |token|
%tr %tr
%td= token.name %td= token.name
%td.input-group.personal-access-tokens-token-column %td.input-group.personal-access-tokens-token-column