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

Commit

Permalink
FIX: Don't populate tags unless tagging is enabled (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX committed May 7, 2021
1 parent 3d849a4 commit ea7c520
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/discourse_dev/tag.rb
Expand Up @@ -11,6 +11,11 @@ def initialize
super(::Tag, DiscourseDev.config.tag[:count])
end

def populate!
return unless SiteSetting.tagging_enabled
super
end

def data
{
name: Faker::Discourse.unique.tag,
Expand Down
2 changes: 2 additions & 0 deletions lib/discourse_dev/topic.rb
Expand Up @@ -53,6 +53,8 @@ def title
end

def tags
return unless SiteSetting.tagging_enabled

@tags = []

Faker::Number.between(from: @settings.dig(:tags, :min), to: @settings.dig(:tags, :max)).times do
Expand Down

0 comments on commit ea7c520

Please sign in to comment.