Sha256: 9b1470f892f52b7ae0c6f430d824455e66210b0feec05f6ba5ebc400aed89777

Contents?: true

Size: 769 Bytes

Versions: 10

Compression:

Stored size: 769 Bytes

Contents

diff --git a/app/models/discourse.rb b/app/models/discourse.rb
index 5451817..93b5fdf 100644
--- a/app/models/discourse.rb
+++ b/app/models/discourse.rb
@@ -121,6 +121,12 @@ class Discourse
         prefix_var = ENV['DISCOURSE_TOPIC_PREFIX']
         prefix = '-' + prefix_var unless prefix_var.blank?
 
+        if entry['title'].nil?
+          title= "JTJ#{prefix.to_s}-#{Date.parse(entry['date']).strftime("%Y/%m/%d")}"
+        else
+          title= "JTJ#{prefix.to_s}-#{Date.parse(entry['date']).strftime("%Y/%m/%d")}-#{entry['title']}"
+        end
+
         topic = Topic.find_by(entry_id: entry['id'])
         unless topic.present?
           Rails.logger.info "[Discourse](create_discourse_topic) Creating new topic for entry #{entry} with title #{title}"

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
danger-wcc-0.1.4 spec/fixtures/flay.diff
danger-wcc-0.1.3 spec/fixtures/flay.diff
danger-wcc-0.1.2 spec/fixtures/flay.diff
danger-wcc-0.1.1 spec/fixtures/flay.diff
danger-wcc-0.1.0 spec/fixtures/flay.diff
danger-wcc-0.0.6 spec/fixtures/flay.diff
danger-wcc-0.0.5 spec/fixtures/flay.diff
danger-wcc-0.0.4 spec/fixtures/flay.diff
danger-wcc-0.0.3 spec/fixtures/flay.diff
danger-wcc-0.0.2 spec/fixtures/flay.diff