Skip to content

Commit

Permalink
Merge pull request #2611 from pat-son/dupeTagFix
Browse files Browse the repository at this point in the history
Duplicate tags can no longer be saved.
  • Loading branch information
pat-son authored Mar 10, 2017
2 parents bff2c32 + c75889f commit 874f96e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ def clone
def create_tag
tag = Tag.find_or_create_by(name: params[:name].to_s.squish)
project = Project.find(params[:id])
project.tags << tag
unless project.tags.exists?(tag.id)
project.tags << tag
end
project.save!
respond_to do |format|
msg = { status: 'ok', message: 'Success!',
Expand Down

0 comments on commit 874f96e

Please sign in to comment.