Skip to content

Commit fe4ffe4

Browse files
committed
feat: add touch option to acts_as_message for chat association
1 parent 27f8347 commit fe4ffe4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ruby_llm/active_record/acts_as.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ def acts_as_chat(message_class: 'Message', tool_call_class: 'ToolCall')
2525
to: :to_llm
2626
end
2727

28-
def acts_as_message(chat_class: 'Chat', tool_call_class: 'ToolCall') # rubocop:disable Metrics/MethodLength
28+
def acts_as_message(chat_class: 'Chat', tool_call_class: 'ToolCall', touch_chat: false) # rubocop:disable Metrics/MethodLength
2929
include MessageMethods
3030

3131
@chat_class = chat_class.to_s
3232
@tool_call_class = tool_call_class.to_s
3333

34-
belongs_to :chat, class_name: @chat_class
34+
belongs_to :chat, class_name: @chat_class, touch: touch_chat
3535
has_many :tool_calls, class_name: @tool_call_class, dependent: :destroy
3636

3737
belongs_to :parent_tool_call,

0 commit comments

Comments
 (0)