mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-08 15:50:08 +09:00
Merge remote-tracking branch 'upstream/main' into cursor/split-sidebar-membership-queries-8545
Co-authored-by: Thomas Klemm <github@tklemm.eu>
This commit is contained in:
@@ -17,6 +17,14 @@ module Message::Searchable
|
||||
end
|
||||
end
|
||||
|
||||
class_methods do
|
||||
# Orders by the index's rowid, which is the message id, so SQLite walks the full-text index
|
||||
# newest first and stops at the page. Ordering by created_at sorted every match before paging.
|
||||
def last_page_of_matches(size)
|
||||
Message::Pagination::Page.load(reorder("idx.rowid"), :last, size)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def create_in_index
|
||||
execute_sql_with_binds "insert into message_search_index(rowid, body) values (?, ?)", id, plain_text_body
|
||||
|
||||
@@ -63,7 +63,7 @@ class Webhook < ApplicationRecord
|
||||
end
|
||||
|
||||
def extract_attachment_from(response)
|
||||
if response.content_type && mime_type = Mime::Type.lookup(response.content_type)
|
||||
if response.code == "200" && response.content_type && mime_type = Mime::Type.lookup(response.content_type)
|
||||
ActiveStorage::Blob.create_and_upload! \
|
||||
io: StringIO.new(response.body), filename: "attachment.#{mime_type.symbol}", content_type: mime_type.to_s
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user