Commit 7909643e authored by Jakub Motycka's avatar Jakub Motycka
Browse files

Merge branch 'fix/period_end-validation' into 'develop'

fix: period_end change validation, changing period_end change terminated? so...

See merge request !1226
parents b1d66518 50db38f0
Pipeline #143324 passed with stage
in 12 minutes and 42 seconds
......@@ -37,7 +37,7 @@ class Assignment < ApplicationRecord
validate :period_end_changeable
def period_end_changeable
if terminated? && period_end_changed? && assignment_log
if termination_verified_by.present? && period_end_changed? && assignment_log
errors.add(:base, :period_end_unchangeable)
end
end
......
......@@ -38,7 +38,7 @@ class GroupAssignment < ApplicationRecord
scope :with_unterminated_staffomatic, (-> { left_outer_joins(:group_offer).merge(GroupOffer.with_staffomatic).unterminated })
def period_end_changeable
if terminated? && period_end_changed? && group_assignment_logs.present?
if termination_verified_by.present? && period_end_changed? && group_assignment_logs.present?
errors.add(:base, :period_end_unchangeable)
end
end
......
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