feat(team_account): add procedures count
This commit is contained in:
parent
6c5ceac1e5
commit
18bb26a7f2
2 changed files with 11 additions and 2 deletions
|
@ -7,6 +7,13 @@ module Manager
|
|||
.order(created_at: :asc)
|
||||
.page(params[:_page])
|
||||
.per(@records_per_page)
|
||||
|
||||
resources.each do |resource|
|
||||
def resource.procedures_count
|
||||
administrateur.procedures.with_discarded.count
|
||||
end
|
||||
end
|
||||
|
||||
page = Administrate::Page::Collection.new(dashboard)
|
||||
|
||||
render locals: {
|
||||
|
|
|
@ -15,7 +15,8 @@ class TeamAccountDashboard < Administrate::BaseDashboard
|
|||
current_sign_in_at: Field::DateTime,
|
||||
last_sign_in_at: Field::DateTime,
|
||||
dossiers: Field::HasMany,
|
||||
procedures: Field::HasMany
|
||||
procedures: Field::HasMany,
|
||||
procedures_count: Field::Number
|
||||
}.freeze
|
||||
|
||||
# COLLECTION_ATTRIBUTES
|
||||
|
@ -26,7 +27,8 @@ class TeamAccountDashboard < Administrate::BaseDashboard
|
|||
COLLECTION_ATTRIBUTES = [
|
||||
:email,
|
||||
:last_sign_in_at,
|
||||
:current_sign_in_at
|
||||
:current_sign_in_at,
|
||||
:procedures_count
|
||||
].freeze
|
||||
|
||||
# SHOW_PAGE_ATTRIBUTES
|
||||
|
|
Loading…
Reference in a new issue