keynote type available only to admins. Able to mark as highlight. Highlights and Keynotes scoped.
This commit is contained in:
parent
5d444143ea
commit
2f6fccb912
5 changed files with 30 additions and 18 deletions
|
|
@ -43,6 +43,14 @@ class Conference < ActiveRecord::Base
|
|||
def confirmed
|
||||
where(state: :confirmed)
|
||||
end
|
||||
|
||||
def keynotes
|
||||
where(state: :confirmed).select { |e| e.event_type.title == 'Keynote'}
|
||||
end
|
||||
|
||||
def highlights
|
||||
where(is_highlight: true)
|
||||
end
|
||||
end
|
||||
has_many :event_users, through: :events
|
||||
has_many :speakers, -> { distinct }, through: :event_users, source: :user do
|
||||
|
|
@ -558,18 +566,6 @@ class Conference < ActiveRecord::Base
|
|||
email_settings.updated_conference_registration_dates_template
|
||||
end
|
||||
|
||||
def keynotes
|
||||
events.where(state: 'confirmed').select { |e| e.event_type.title == 'Keynote'}
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# ====Returns
|
||||
# * +Array+ -> Events with attribute 'is_highlight'
|
||||
def highlights
|
||||
events.where(is_highlight: true)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
after_create do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue