Method: Learndot::Events#enrollment_count
- Defined in:
- lib/learndot/events.rb
#enrollment_count(class_id) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/learndot/events.rb', line 36 def enrollment_count(class_id) sessions = @api.search(:course_session, { 'eventId' => [class_id] }) if ! sessions.empty? enrolment_ids = sessions.collect { | k, cs | cs['enrolmentId'] } enrollment_conditions = { 'id' => enrolment_ids, 'status' => ['TENTATIVE', 'APPROVED', 'CONFIRMED'] } count = @api.count('enrolment', enrollment_conditions) end return count || 0 end |