Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
FIX: Retry creating tags (#8)
Browse files Browse the repository at this point in the history
In case there are any errors (i.e. name collision)
  • Loading branch information
CvX committed May 7, 2021
1 parent e56132a commit 80937a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/discourse_dev/tag.rb
Expand Up @@ -11,6 +11,13 @@ def initialize
super(::Tag, DiscourseDev.config.tag[:count])
end

def create!
super
rescue ActiveRecord::RecordInvalid => e
# If the name is taken, try again
retry
end

def populate!
return unless SiteSetting.tagging_enabled
super
Expand Down

0 comments on commit 80937a8

Please sign in to comment.