Commit c3760fb2 authored by Jiri Strojil's avatar Jiri Strojil
Browse files

Possibly fixed all the tests

parent 5fbfb33b
Pipeline #29261 failed with stage
in 51 minutes and 11 seconds
......@@ -12,8 +12,8 @@ class SemesterProcessVolunteersController < ApplicationController
def submit_review
assign_reviewed_attributes
set_reviewed
@semester_process_volunteer.volunteer.validate_waive_and_bank = true
begin
ActiveRecord::Base.transaction do
@semester_process_volunteer.semester_feedbacks << @feedback
......
......@@ -82,7 +82,7 @@ class Volunteer < ApplicationRecord
#
validates :contact, presence: true
validates_presence_of :iban, :bank, unless: :waive?
validates_presence_of :iban, :bank, if: -> { validate_waive_and_bank && waive.blank? }
validates :salutation, presence: true
validates_attachment :avatar, content_type: {
content_type: /\Aimage\/.*\z/
......@@ -92,6 +92,8 @@ class Volunteer < ApplicationRecord
if: :external?,
unless: :user_deleted?
attr_accessor :validate_waive_and_bank
scope :process_eq, lambda { |process|
return unless process.present?
return joins(:user).merge(User.with_pending_invitation) if process == 'havent_logged_in'
......
Supports Markdown
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