mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-08 22:14:04 +08:00
init project
This commit is contained in:
9
app/models/private_message.rb
Normal file
9
app/models/private_message.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class PrivateMessage < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :target, class_name: "User"
|
||||
belongs_to :sender, class_name: "User"
|
||||
belongs_to :receiver, class_name: "User"
|
||||
|
||||
scope :without_deleted, -> { where.not(status: 2) }
|
||||
scope :only_unread, -> { where(status: 0) }
|
||||
end
|
||||
Reference in New Issue
Block a user