remove semester_process_helper and ad its methods to semester_processes controller

because this helper methods where:

1. only used in that controller, so including them from else where makes no sense
2. even if they where used in multiple controllers, the things should have been in a concern
parent 8ebab126
......@@ -2,8 +2,6 @@ class SemesterProcessesController < ApplicationController
before_action :set_semester_process, only: [:edit, :update, :overdue]
before_action :set_semester, only: [:new, :create]
include SemesterProcessHelper
def new
@semester_process = SemesterProcess.new(semester: @selected_semester, kind: :mail )
new_or_edit
......@@ -63,6 +61,12 @@ class SemesterProcessesController < ApplicationController
end
end
def sort_volunteers
@semester_process.new_semester_process_volunteers.sort do |spv1, spv2|
spv1.volunteer.contact.full_name <=> spv2.volunteer.contact.full_name
end
end
def update_or_create
authorize @semester_process
......
module SemesterProcessHelper
def sort_volunteers
@semester_process.new_semester_process_volunteers.sort do |spv1, spv2|
spv1.volunteer.contact.full_name <=> spv2.volunteer.contact.full_name
end
end
end
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