@@ -17,12 +17,12 @@ def template_attribute_details(template_attribute)
1717 def load_templates
1818 privilege = Seek ::Permissions ::Translator . translate ( 'view' )
1919 Template . order ( :group , :group_order ) . select { |t | t . can_perform? ( privilege ) } . map do |item |
20- { title : item . title &. sanitize ,
21- group : item . group &. sanitize ,
22- level : item . level &. sanitize ,
23- organism : item . organism &. sanitize ,
20+ { title : sanitize ( item . title ) ,
21+ group : sanitize ( item . group ) ,
22+ level : sanitize ( item . level ) ,
23+ organism : sanitize ( item . organism ) ,
2424 template_id : item . id ,
25- description : item . description &. sanitize ,
25+ description : sanitize ( item . description ) ,
2626 group_order : item . group_order ,
2727 attributes : item . template_attributes . order ( :pos ) . map { |a | map_template_attributes ( a ) } }
2828 end
@@ -77,19 +77,19 @@ def template_attribute_type_link(template_attribute)
7777 def map_template_attributes ( attribute )
7878 {
7979 attribute_type_id : attribute . sample_attribute_type_id ,
80- data_type : SampleAttributeType . find ( attribute . sample_attribute_type_id ) &.title &. sanitize ,
80+ data_type : sanitize ( SampleAttributeType . find ( attribute . sample_attribute_type_id ) &.title ) ,
8181 cv_id : attribute . sample_controlled_vocab_id ,
8282 allow_cv_free_text : attribute . allow_cv_free_text ,
83- title : attribute . title &. sanitize ,
83+ title : sanitize ( attribute . title ) ,
8484 is_title : attribute . is_title ,
85- short_name : attribute . short_name &. sanitize ,
86- description : attribute . description &. sanitize ,
87- pid : attribute . pid &. sanitize ,
85+ short_name : sanitize ( attribute . short_name ) ,
86+ description : sanitize ( attribute . description ) ,
87+ pid : sanitize ( attribute . pid ) ,
8888 required : attribute . required ,
8989 unit_id : attribute . unit_id ,
9090 pos : attribute . pos ,
9191 isa_tag_id : attribute . isa_tag_id ,
92- isa_tag_title : attribute . isa_tag &.title &. sanitize ,
92+ isa_tag_title : sanitize ( attribute . isa_tag &.title ) ,
9393 linked_sample_type_id : attribute . linked_sample_type_id ,
9494 template_attribute_id : attribute . id
9595 }
0 commit comments