class Sessions::RecordController
Public Instance Methods
Source
# File app/controllers/sessions/record_controller.rb, line 37 def edit_batch id = todays_batch_id(programme: @programme, vaccine_method: @vaccine_method) @todays_batch = authorize @batches.find(id), :edit? render :batch end
Source
# File app/controllers/sessions/record_controller.rb, line 13 def show scope = @session.patients.includes_statuses.includes(notes: :created_by) if @session.requires_registration? scope = scope.has_registration_status( %w[attending completed], session: @session ) end patients = filter_on_vaccine_method_or_patient_specific_direction( @form.apply(scope) ).consent_given_and_safe_to_vaccinate( programmes: @form.programmes, academic_year: @session.academic_year ) @pagy, @patients = pagy_array(patients) render layout: "session" end
Source
# File app/controllers/sessions/record_controller.rb, line 44 def update_batch @todays_batch = authorize @batches.find_by(id: params.dig(:batch, :id)), :update? if @todays_batch self.todays_batch = @todays_batch redirect_to session_record_path(@session), flash: { success: "The default batch for this session has been updated" } else @todays_batch = Batch.new @todays_batch.errors.add(:id, "Select a default batch for this session") render :batch, status: :unprocessable_content end end