mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 16:18:42 -05:00
18 lines
393 B
Ruby
18 lines
393 B
Ruby
|
module Jobs
|
||
|
|
||
|
# Asynchronously send an email to a user
|
||
|
class ViewTracker < Jobs::Base
|
||
|
def execute(args)
|
||
|
topic_id = args[:topic_id]
|
||
|
user_id = args[:user_id]
|
||
|
ip = args[:ip]
|
||
|
track_visit = args[:track_visit]
|
||
|
|
||
|
View.create_for_parent(Topic, topic_id, ip, user_id)
|
||
|
if track_visit
|
||
|
TopicUser.track_visit! topic_id, user_id
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|