Use validated resource_params instead of plain params

… as well as properly fill :keywords_attributes as collection rather than single model

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

See: https://github.com/mastodon/mastodon/pull/35133#discussion_r2163366096

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Sebastian Hädrich 2025-06-24 17:35:41 +02:00 committed by GitHub
parent f69352fe56
commit c6bef7522b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,7 @@ class FiltersController < ApplicationController
def new def new
@filter = current_account.custom_filters.build(action: :warn) @filter = current_account.custom_filters.build(action: :warn)
@filter.keywords.build(params.dig(:custom_filter, :keywords_attributes)) @filter.keywords.build(resource_params.dig(:keywords_attributes, '0'))
end end
def edit; end def edit; end