We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b2c7e9 commit 775498fCopy full SHA for 775498f
lib/ruby_llm/active_record/acts_as.rb
@@ -150,12 +150,14 @@ def create_user_message(content, with: nil)
150
)
151
152
if with.present?
153
- files = Array(with).reject(&:blank?)
154
-
155
- if files.any? && files.first.is_a?(ActionDispatch::Http::UploadedFile)
156
- message_record.attachments.attach(files)
157
- else
158
- attach_files(message_record, process_attachments(with))
+ files = Array(with).reject(&:empty?)
+
+ if files.any?
+ if files.first.is_a?(ActionDispatch::Http::UploadedFile)
+ message_record.attachments.attach(files)
+ else
159
+ attach_files(message_record, process_attachments(with))
160
+ end
161
end
162
163
0 commit comments