summaryrefslogtreecommitdiff
path: root/app/controllers/groups/milestones_controller.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-04-05 11:51:19 -0300
committerFelipe Artur <felipefac@gmail.com>2016-04-07 10:59:24 -0300
commit0bef4b97647893df8cf0a781f768b1775ae2bb58 (patch)
treec72043d7b4263efd229d93329237a60d0e0684da /app/controllers/groups/milestones_controller.rb
parent32c7e42b612bdda43eeef55d8c8afdc9eeb33785 (diff)
downloadgitlab-ce-0bef4b97647893df8cf0a781f768b1775ae2bb58.tar.gz
Implement review suggestions
Diffstat (limited to 'app/controllers/groups/milestones_controller.rb')
-rw-r--r--app/controllers/groups/milestones_controller.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb
index fcf19e8066a..9d5a28e8d4d 100644
--- a/app/controllers/groups/milestones_controller.rb
+++ b/app/controllers/groups/milestones_controller.rb
@@ -21,7 +21,7 @@ class Groups::MilestonesController < Groups::ApplicationController
project_ids = params[:milestone][:project_ids].reject(&:blank?)
title = milestone_params[:title]
- if create_milestones(project_ids, title)
+ if create_milestones(project_ids)
redirect_to milestone_path(title)
else
render_new_with_error(project_ids.empty?)
@@ -41,7 +41,7 @@ class Groups::MilestonesController < Groups::ApplicationController
private
- def create_milestones(project_ids, title)
+ def create_milestones(project_ids)
return false unless project_ids.present?
ActiveRecord::Base.transaction do
@@ -51,9 +51,7 @@ class Groups::MilestonesController < Groups::ApplicationController
end
true
-
- rescue => e
-
+ rescue ActiveRecord::ActiveRecordError => e
flash.now[:alert] = "An error occurred while creating the milestone: #{e.message}"
false
end