Moin
12 Diciembre, 2025 09:57
1
Sé que hay una configuración en mis preferencias de interfaz, pero de alguna manera no me funciona:
Dice “cambios guardados”, pero el valor en la base de datos sigue siendo “true”, por lo que después de una recarga vuelve a aparecer habilitado.
1 me gusta
pfaffman
(Jay Pfaffman)
12 Diciembre, 2025 11:53
3
Extraño. ¿Has intentado verlo en Rails?
Moin
12 Diciembre, 2025 11:59
4
¿Cómo hago eso? Meta no es mi foro
1 me gusta
Me siento reacio a usar modifyClass, pero no pude encontrar una forma mejor (cc @david / @cvx )
main ← fix-save-ai-search-discovery-user-preference
opened 01:09PM - 12 Dec 25 UTC
The "Enable AI search discoveries" checkbox in user preferences wasn't persistin… g changes. The UI showed "saved" but the value never reached the database.
The Interface controller's `saveAttrNames` is a computed property that returns a new array on each access. While the plugin called `addSaveableUserOptionField()`, this only registers the field with the User model. The controller filters which fields to save via `saveAttrNames`, and since `ai_search_discoveries` wasn't in that list, it was excluded from the save request.
Fix by using `modifyClass` to extend the controller's `save()` action, pushing `ai_search_discoveries` to `saveAttrNames` at the moment of saving before calling the parent method.
Ref - meta/t/391135
1 me gusta
david
(David Taylor)
12 Diciembre, 2025 13:10
6
De hecho, modifyClass no es lo ideal, especialmente en un complemento principal.
Lo mejor sería introducir un nuevo valueTransformer en el núcleo, para que tengamos una forma “soportada” de hacer este tipo de cosas.
3 Me gusta
Moin
12 Diciembre, 2025 23:48
8
Gracias. Finalmente está deshabilitado