Commit 34f0683b authored by Jiri Strojil's avatar Jiri Strojil

Fixed displaying of semester

parent 15de6226
Pipeline #31133 failed with stage
in 60 minutes
......@@ -37,7 +37,7 @@ class SemesterProcessVolunteersController < ApplicationController
authorize SemesterProcessVolunteer
semester = Semester.parse(params[:semester])
@spvs = SemesterProcessVolunteer.index(semester).page(params[:page])
@semester_process = SemesterProcess.find_by_semester(semester)
@semester_process = SemesterProcess.find_by_semester(semester).last
@spvs_sorted = @spvs.sort { |spv1, spv2| spv1.volunteer.contact.full_name <=> spv2.volunteer.contact.full_name}
end
......
......@@ -19,7 +19,7 @@ class SemesterProcess < ApplicationRecord
attr_accessor :new_semester_process_volunteers
scope :find_by_semester, lambda { |semester = nil|
where('semester && daterange(?,?)', semester.begin, semester.end).last
where('semester && daterange(?,?)', semester.begin, semester.end)
}
def mails
......
......@@ -3,6 +3,6 @@ nav.navbar.section-navigation
ul.list-inline
li= button_link 'Neuen Semester Prozess erstellen', new_semester_process_path, dimension: 'sm'
li= render 'semester_filter'
- if @semester_process.present?
- if @semester_process
li= button_link 'Semester Prozess bearbeiten', edit_semester_process_path(@semester_process), dimension: 'sm'
hr
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment