Class: SiriusApi::SemesterFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/sirius_api/semester_filter.rb

Instance Method Summary collapse

Instance Method Details

#filter(dataset, params) ⇒ Object


7
8
9
10
# File 'lib/sirius_api/semester_filter.rb', line 7

def filter(dataset, params)
  faculty_id = params[:faculty]
  dataset.then_if(faculty_id) { |d| d.where(faculty: faculty_id) }
end