Commit c0c0cd25 authored by Mark Chao's avatar Mark Chao

Extract condition as method for clarity

parent f68eda2b
......@@ -9,7 +9,7 @@ module EE
def execute(milestone)
super
if milestone.previous_changes.key?(:start_date) || milestone.previous_changes.key?(:due_date)
if dates_changed?(milestone)
::Epic.update_dates(
::Epic.joins(:issues).where(issues: { milestone_id: milestone.id })
)
......@@ -17,6 +17,13 @@ module EE
milestone
end
private
def dates_changed?(milestone)
changes = milestone.previous_changes
changes.include?(:start_date) || changes.include?(:due_date)
end
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