Transition to answers part 6 - #14645
Open
sebastienhoorens wants to merge 26 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The exporting controllers preload the answers of their records, or of their records' authors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The auto insights matrix passes the answerable records themselves, rather than plucking their custom_field_values along. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keys stored with an explicit null value now count as unanswered for permission requirements and onboarding completeness. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Part 4 accidentally overwrote the factory that the answers table introduced, losing its custom field association. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The domicile export contexts stay on custom_field_values: built-in user fields read through their store accessors, which are hash-backed until the hash retires. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Answer values remain searchable, while the internal field keys no longer match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extracting goto_page_id retired the previous worst offender. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The JSON-schema validation of user custom_field_values moves from a model validation to UserService.upsert_in_web_api, the only place where it could actually trigger. The schemas themselves move from CustomFieldService's metaprogrammed methods into the input type strategies, composed by the new CustomFieldValuesValidationService. The invites xlsx processor now casts cell values through the strategies instead of interpreting the JSON schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The *_to_ui_schema_field methods call base_ui_schema_field, which is defined nowhere, so any call would raise. handle_description no longer has callers either. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Publishing an input (create or update) now validates its custom_field_values against the field schemas, like the registration boundary does for users. Draft saves stay unvalidated, and user field values merged into the input (u_-prefixed keys) are skipped. The update action's params massaging moves into prepare_update_params to keep the method within size limits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Preload the options for the registration field schemas, remove the dead CustomFieldService#pages, inline the one-caller custom_field_keys, and restructure the validation service spec around a let_it_be field pool. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…schema-validation
…schema-validation
The custom field answers become the source of truth. Writes stage answers in-memory (CustomFieldValuesTransitionService at the ingestion boundaries, persisted by the record's save through autosave), reads and the API's custom_field_values output derive from the answers, and the jsonb column stays only as an untouched backup (ignored_columns). The sync mechanism is gone, the built-in demographics accessors are answer-backed and code-resolved, and nil-containing values are now rejected by a model validation on the answers. Specs follow separately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Option and field deletion keep only their answers SQL, the null-values check becomes a CustomFieldAnswer validation (dropping the checker's User special case), and file destruction removes the referencing answers. Templates and project copies serialize CustomFieldAnswer records with answerable and custom_field refs — answers of fields outside the template (registration fields in project copies) are not copied, following the usual unresolvable-ref filtering. The deserializer still accepts the custom_field_values of older template files. The bulk and decidim importers and the seeds stage answers, and the sync backfill task is deleted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The custom_field_answer factory resolves its field from the key, specs build answers instead of assigning custom_field_values hashes (with the parent field passed explicitly for _other and _follow_up companions), and boundary specs call the transition service explicitly. Also fixes update_merging_custom_fields! for attribute-less calls, found by the specs. Covers the models, the survey generators and the first service specs; the remaining buckets follow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
For translators