blob: f0ae5445a463ba174aece6d2a0cf868c218a23f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# frozen_string_literal: true
module Users
class SavedReply < ApplicationRecord
self.table_name = 'saved_replies'
belongs_to :user
validates :user_id, :name, :content, presence: true
validates :name,
length: { maximum: 255 },
uniqueness: { scope: [:user_id] }
validates :content, length: { maximum: 10000 }
def self.find_saved_reply(user_id:, id:)
::Users::SavedReply.find_by(user_id: user_id, id: id)
end
end
end
|