LINT ALL THE THINGS

This commit is contained in:
zogstrip 2025-02-07 11:05:15 +01:00
parent f24ab50fa4
commit d89b60da2e
No known key found for this signature in database
3 changed files with 12 additions and 15 deletions

View File

@ -281,11 +281,12 @@ after_initialize do
if category_id
if include_subcategories
accepted_solutions =
accepted_solutions
.where("topics.category_id IN (?)", Category.subcategory_ids(category_id))
accepted_solutions.where(
"topics.category_id IN (?)",
Category.subcategory_ids(category_id),
)
else
accepted_solutions =
accepted_solutions.where("topics.category_id = ?", category_id)
accepted_solutions = accepted_solutions.where("topics.category_id = ?", category_id)
end
end
@ -400,9 +401,7 @@ after_initialize do
end
register_modifier(:user_action_stream_builder) do |builder|
builder
.where("t.deleted_at IS NULL")
.where("t.archetype <> ?", Archetype.private_message)
builder.where("t.deleted_at IS NULL").where("t.archetype <> ?", Archetype.private_message)
end
TopicList.preloaded_custom_fields << ::DiscourseSolved::ACCEPTED_ANSWER_POST_ID_CUSTOM_FIELD

View File

@ -601,13 +601,11 @@ RSpec.describe "Managing Posts solved status" do
t2.convert_to_private_message(Discourse.system_user)
expect(
UserAction
.stream(
UserAction.stream(
user_id: user.id,
action_types: [::UserAction::SOLVED],
guardian: user.guardian
)
.map(&:post_id)
guardian: user.guardian,
).map(&:post_id),
).to contain_exactly p3.id
end
end