Commit ee6a8dad authored by Sean Carroll's avatar Sean Carroll

Apply maintainer suggestion

parent 41e9a784
......@@ -12,12 +12,12 @@ module Releases
return error("Milestone(s) not found: #{inexistent_milestones.join(', ')}", 400) if inexistent_milestones.any?
if param_for_milestone_titles_provided?
@previous_milestones = release.milestones.map(&:title)
previous_milestones = release.milestones.map(&:title)
params[:milestones] = milestones
end
if release.update(params)
success(tag: existing_tag, release: release, milestones_updated: milestones_updated?)
success(tag: existing_tag, release: release, milestones_updated: milestones_updated?(previous_milestones))
else
error(release.errors.messages || '400 Bad request', 400)
end
......@@ -33,10 +33,10 @@ module Releases
params.except(:tag).empty?
end
def milestones_updated?
def milestones_updated?(previous_milestones)
return false unless param_for_milestone_titles_provided?
@previous_milestones.to_set != release.milestones.map(&:title)
previous_milestones.to_set != release.milestones.map(&:title)
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