mirror of
https://github.com/anteo/redmine_custom_workflows.git
synced 2026-01-26 00:04:20 +00:00
Fixed issue status validation (#8938)
This commit is contained in:
parent
4f477012f3
commit
d9a6f1feae
@ -13,6 +13,7 @@ module RedmineCustomWorkflows
|
||||
|
||||
module InstanceMethods
|
||||
def validate_status
|
||||
return true unless @extra_validation
|
||||
if status_id_was != status_id && !new_statuses_allowed_to(User.current, new_record?).collect(&:id).include?(status_id)
|
||||
status_was = IssueStatus.find_by_id(status_id_was)
|
||||
status_new = IssueStatus.find_by_id(status_id)
|
||||
@ -47,7 +48,10 @@ module RedmineCustomWorkflows
|
||||
|
||||
def before_save_custom_workflows
|
||||
saved_attributes = attributes.dup
|
||||
run_custom_workflows(:before_save) && (saved_attributes == attributes || valid?)
|
||||
@extra_validation = true
|
||||
result = run_custom_workflows(:before_save) && (saved_attributes == attributes || valid?)
|
||||
@extra_validation = false
|
||||
result
|
||||
end
|
||||
|
||||
def after_save_custom_workflows
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user