7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/jobs/thredded/activity_updater_job.rb', line 7
def perform(user_id, messageboard_id)
now = Time.current
begin
user_detail = Thredded::UserDetail.find_or_initialize_by(user_id: user_id)
user_detail.update!(last_seen_at: now)
rescue ActiveRecord::RecordNotUnique
retry
end
begin
Thredded::MessageboardUser
.find_or_initialize_by(
thredded_messageboard_id: messageboard_id,
thredded_user_detail_id: user_detail.id
)
.update!(last_seen_at: now)
rescue ActiveRecord::RecordNotUnique
retry
end
end
|