Project

General

Profile

Patch #27124 » issue.rb.patch

Pavel Rosický, 2017-10-05 03:13

View differences:

issue.rb (working copy)
end
}
before_save { @in_before_save_callback = true }
after_save { @in_before_save_callback = false }
before_validation :default_assign, on: :create
before_validation :clear_disabled_fields
before_save :close_duplicates, :update_done_ratio_from_issue_status,
......
# Returns the original tracker
def tracker_was
Tracker.find_by_id(tracker_id_in_database)
Tracker.find_by(:id => tracker_id_was)
end
# Returns the previous assignee whenever we're before the save
# or in after_* callbacks
# Returns the previous assignee
def previous_assignee
# This is how ActiveRecord::AttributeMethods::Dirty checks if we're in a after_* callback
if previous_assigned_to_id = mutation_tracker.equal?(mutations_from_database) ? assigned_to_id_in_database : assigned_to_id_before_last_save
Principal.find_by_id(previous_assigned_to_id)
end
Principal.find_by(:id => @in_before_save_callback ? assigned_to_id_before_last_save : assigned_to_id_was)
end
# Returns the users that should be notified
    (1-1/1)