discourse/app/jobs/regular/view_tracker.rb

18 lines
353 B
Ruby
Raw Normal View History

module Jobs
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
2014-03-31 14:14:21 +08:00
end