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