correct past and upcoming conferences in admin/organizations#index
This commit is contained in:
parent
036b590823
commit
eb23d838b5
3 changed files with 21 additions and 2 deletions
|
|
@ -7,6 +7,8 @@ class Conference < ActiveRecord::Base
|
|||
resourcify :roles, dependent: :delete_all
|
||||
|
||||
default_scope { order('start_date DESC') }
|
||||
scope :upcoming, (-> { where('end_date >= ?', Date.current) })
|
||||
scope :past, (-> { where('end_date < ?', Date.current) })
|
||||
|
||||
belongs_to :organization
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
%td
|
||||
= organization.name
|
||||
%td
|
||||
= organization.conferences.count
|
||||
= organization.conferences.upcoming.count
|
||||
%td
|
||||
= organization.conferences.count
|
||||
= organization.conferences.past.count
|
||||
%td
|
||||
.btn-group
|
||||
= link_to 'Edit', edit_admin_organization_path(organization),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue