Reimplement speaker listing
This commit is contained in:
parent
8d2c197124
commit
b679efbd2b
|
@ -3,6 +3,6 @@ class Api::SpeakersController < Api::ApplicationController
|
|||
before_filter :require_current_conference!
|
||||
|
||||
def index
|
||||
@speakers = PersonalProfile.joins(user: [{events: [:slot] }]).where(conference: current_conference).uniq
|
||||
@speakers = PersonalProfile.joins(user: {participations: {event: :proposition}}).where(events: {id: current_conference.approved_events.pluck(:id)}).distinct
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,8 +14,7 @@ class Conference < ActiveRecord::Base
|
|||
has_many :halls
|
||||
has_many :event_types
|
||||
has_many :events
|
||||
has_many :approved_events,
|
||||
-> { joins(:proposition).where(propositions: {status: Proposition.statuses[:approved]}) }, class_name: 'Event'
|
||||
has_many :approved_events, -> { joins(:proposition).approved }, class_name: 'Event'
|
||||
has_many :conflict_counts, through: :events
|
||||
has_many :volunteer_teams
|
||||
has_many :volunteers
|
||||
|
|
|
@ -15,6 +15,7 @@ class Event < ActiveRecord::Base
|
|||
belongs_to :event_type
|
||||
|
||||
scope :ranked, -> { where.not(ranked: nil).where.not(votes: nil) }
|
||||
scope :approved, -> { where(propositions: {status: Proposition.statuses[:approved]})}
|
||||
|
||||
validates :conference, presence: true
|
||||
validates :title, presence: true
|
||||
|
|
Loading…
Reference in New Issue