Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contenedores_archivos = DocumentAttribute.find_by_name("contenedores archivos")
- #<DocumentAttribute:0x00000001144f7080
- id: 145,
- name: "contenedores archivos",
- type_cd: 3,
- active: nil,
- created_at: Sat, 08 Jun 2024 00:14:21 -04 -04:00,
- updated_at: Thu, 15 May 2025 22:13:20 -04 -04:00,
- deleted_at: nil,
- document_attribute_id: nil,
- description: nil,
- ner_type: nil,
- local_id: "42e4ee2f-b809-4ffe-b7e0-7ad72124529c",
- allows_create_options_on_classification: false,
- luego tiene N grupos
- {
- id: 1,
- attribute_parent_id: "115", -> padre -> el que debo seleccionar "tipos de docu"
- attribute_child_id: "145", -> atributo principal "contenedores archivos"
- customer_id: 1
- value: "pdf", hijo -> la opcion del padre que debo seleccionar "pdf"
- }
- tipos_docu = DocumentAttribute.find_by_name("tipos de docu")
- => #<DocumentAttribute:0x000000011224ad20
- id: 115,
- name: "tipos de docu",
- type_cd: 3,
- active: nil,
- created_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- updated_at: Wed, 16 Apr 2025 13:02:48 -04 -04:00,
- deleted_at: nil,
- document_attribute_id: nil,
- description: nil,
- ner_type: nil,
- local_id: "67e41877-a2db-4ca9-adce-97319f5c3b3d",
- allows_create_options_on_classification: true,
- position: 3,
- autofill: false>
- tipos_docu.options
- => [#<DocumentAttributeOption:0x00000001064a2f70
- id: 433,
- document_attribute_id: 115,
- value: "word",
- active: nil,
- created_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- updated_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- customer_id: 1,
- tag: nil,
- struct_attributes: nil,
- deleted_at: nil,
- local_id: "72c38270-3c4c-4208-80cb-47cc5b166b77">,
- #<DocumentAttributeOption:0x00000001064a2a20
- id: 434,
- document_attribute_id: 115,
- value: "pdf",
- active: nil,
- created_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- updated_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- customer_id: 1,
- tag: nil,
- struct_attributes: nil,
- deleted_at: nil,
- local_id: "be16b1f2-a530-4908-a1c5-5c593b7dfdf1">]
- si selecciono "tipos de docu" y luego la opcion pdf aparece contenedores de archivos
- {
- id: 3,
- attribute_parent_id: "topic",
- attribute_child_id: "145",
- customer_id: 1,
- value: "empty"
- }
- Otro caso si selecciono "Asunto" que es topic y si selecciono la opcion "empty" aparece contenedores de archivos
- parent_1 = DocumentAttribute.find_by_name("tipos de docu")
- #<DocumentAttribute:0x0000000105dcfdb0
- id: 115,
- name: "tipos de docu",
- type_cd: 3,
- active: nil,
- created_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- updated_at: Wed, 16 Apr 2025 13:02:48 -04 -04:00,
- deleted_at: nil,
- document_attribute_id: nil,
- description: nil,
- ner_type: nil,
- local_id: "67e41877-a2db-4ca9-adce-97319f5c3b3d",
- allows_create_options_on_classification: true,
- child_1 = parent_1.document_attribute_options.find_by_value("pdf")
- #<DocumentAttributeOption:0x0000000117072ca0
- id: 434,
- document_attribute_id: 115,
- value: "pdf",
- active: nil,
- created_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- updated_at: Tue, 10 Oct 2023 16:19:53 -03 -03:00,
- customer_id: 1,
- tag: nil,
- struct_attributes: nil,
- deleted_at: nil,
- local_id: "be16b1f2-a530-4908-a1c5-5c593b7dfdf1">
- caso de estaticos
- {
- id: 3,
- attribute_parent_id: "topic",
- attribute_child_id: "145",
- customer_id: 1,
- value: "empty"
- },
- buscar topic -> o equivalente "Asunto" => padre
- buscar topic con value "empty" => hijo child Topic.find_by_name("empty")
- endpoint trae todos los atributos de tipo lista CON opciones y que no sean de tipo topic/subject/etc
- servicio de creacion de nesteed attributes para grupos/padres/hijos
- agregar a actuales atributos los childs atributes
- agregar atributo boolean a las colecciones para saber si requieren atencion
- que sucede con la migracion de atributos actuales, con respecto a los que usan topic/subject/etc? no se migraran?
- atributo -> dependencia1/dependencia2
- se elimina la dependencia2
- la coleccion tiene la dependencia1, es necesario avisar que se elimino la dependencia2? o que cambie algo en esa coleccion en especifico?
- lo mismo al editar... ???
- si un atributo tiene 2 dependencias y se elimina una dependencia pero la coleccion ya tiene la otra
- endpoint para devolver atributos de tipo lista siempre y cuando tengan opciones
- criterios
- un atributo no se puede mostrar a si mismo
Advertisement
Add Comment
Please, Sign In to add comment