Skip to content

Commit

Permalink
Duplicate tags can no longer be saved.
Browse files Browse the repository at this point in the history
Still need to add error message when a duplicate tag is submitted
  • Loading branch information
pat-son committed Mar 10, 2017
1 parent bff2c32 commit c75889f
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 c75889f

Please sign in to comment.