007
13. April 2020 um 20:28
1
I can’t seem to find where those heart clicks go in the Discourse database.
Can somebody point me in the right direction?
Thanks!
1 „Gefällt mir“
justin
(Justin DiRose)
13. April 2020 um 20:33
2
Have a look at PostAction – there are a few different types.
# frozen_string_literal: true
class PostAction < ActiveRecord::Base
include RateLimiter::OnCreateRecord
include Trashable
belongs_to :post
belongs_to :user
belongs_to :post_action_type
belongs_to :related_post, class_name: "Post"
belongs_to :target_user, class_name: "User"
rate_limit :post_action_rate_limiter
scope :spam_flags, -> { where(post_action_type_id: PostActionType.types[:spam]) }
scope :flags, -> { where(post_action_type_id: PostActionType.notify_flag_type_ids) }
scope :publics, -> { where(post_action_type_id: PostActionType.public_type_ids) }
scope :active, -> { where(disagreed_at: nil, deferred_at: nil, agreed_at: nil, deleted_at: nil) }
after_save :update_counters
This file has been truncated. show original
8 „Gefällt mir“
pfaffman
(Jay Pfaffman)
13. April 2020 um 21:32
3
I sometimes just update the like_count in the post model. I’m not quite sure if those might somehow get overwritten by some process that builds that number from the post_action model, though.
If Xenforo has a table with every user’s every like, then you can import into post_actions if not, you can just stick it in the like_count and hope for the best.