Add user page to admin panel, improve other admin pages #88
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/admin_user_details"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: Add user page to admin panel, improve other admin pagesto Add user page to admin panel, improve other admin pagesAdd user page to admin panel, improve other admin pagesto WIP: Add user page to admin panel, improve other admin pagesWIP: Add user page to admin panel, improve other admin pagesto Add user page to admin panel, improve other admin pagesLooks very good. I haven't railsed in a while, so I'm not quite sure if the DB question/suggestion makes sense :D
@ -0,0 +10,4 @@
@stats = {
users_confirmed: User.where(ou: @ou).confirmed.count,
users_pending: User.where(ou: @ou).pending.count
Isn't this creating a new DB
COUNT
query? Since the@users
are already there, wouldn't a@users.pending.size
be more performant?@users
is not filtered by pending at that point, so.pending
would actually create a query that selects all fields from the table using that filter, and then.size
would convert the results into an array and count the contained items I believe. So.count
should be more performant if that is correct.@ -40,3 +40,3 @@
namespace :admin do
root to: 'dashboard#index'
get 'ldap_users', to: 'ldap_users#index'
resources 'users', param: 'address', only: ['index', 'show'], constraints: { address: /.*/ }
What's the
constraints
for? Doesn't the regex basically allow anything?It's to prevent Rails from parsing out the part behind the dot character as a format type. It would otherwise regard e.g. the "org" in "user@kosmos.org" as format "org".