mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 20:00:49 +08:00
8 lines
251 B
Ruby
8 lines
251 B
Ruby
class Watcher < ApplicationRecord
|
|
belongs_to :user
|
|
|
|
belongs_to :watchable, polymorphic: true, counter_cache: :watchers_count
|
|
|
|
scope :watching_users, ->(watchable_id){ where("watchable_type = ? and user_id = ?",'User',watchable_id)}
|
|
end
|