1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-20 13:49:39 +02:00
Maybe/app/models/message.rb

11 lines
288 B
Ruby
Raw Normal View History

2025-03-12 12:39:16 -04:00
class Message < ApplicationRecord
belongs_to :chat
enum :role, { user: "user", assistant: "assistant", system: "system" }
validates :content, presence: true
validates :role, presence: true
scope :conversation, -> { where(debug_mode: false, role: [ :user, :assistant ]) }
end