@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.
`@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.
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".
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".
raucao
merged commit 7fd564726f into master2023-02-26 14:16:41 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Looks 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.countIsn't this creating a new DB
COUNTquery? Since the@usersare already there, wouldn't a@users.pending.sizebe more performant?@usersis not filtered by pending at that point, so.pendingwould actually create a query that selects all fields from the table using that filter, and then.sizewould convert the results into an array and count the contained items I believe. So.countshould be more performant if that is correct.@@ -40,3 +40,3 @@namespace :admin doroot to: 'dashboard#index'get 'ldap_users', to: 'ldap_users#index'resources 'users', param: 'address', only: ['index', 'show'], constraints: { address: /.*/ }What's the
constraintsfor? 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".