We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1908109 commit e034d62Copy full SHA for e034d62
app/models/event.rb
@@ -50,9 +50,11 @@ class Event < ApplicationRecord
50
self.topic = tags.find { |tag| tag[0] == "t" }&.[](1)
51
self.recipient = tags.find { |tag| tag[0] == "p" }&.[](1)
52
53
- self.conversation ||= Conversation.find_or_create_by(pubkey: pubkey, session: session) do |c|
54
- c.latest_event_created_at = created_at
55
- c.events_count = 0
+ if session
+ self.conversation ||= Conversation.find_or_create_by(pubkey: pubkey, session: session) do |c|
+ c.latest_event_created_at = created_at
56
+ c.events_count = 0
57
+ end
58
end
59
60
0 commit comments