Skip to content

Commit

Permalink
[TAN-2625] Combine 3 queries into one
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjagit committed Sep 12, 2024
1 parent 3373117 commit c588d1d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions back/app/services/project_copy_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,11 @@ def map_codes(craftjs_json, layout_images_mapping, layout_service = ContentBuild
end

def project_map_configs
custom_forms = CustomForm.where(participation_context: [@project, *@project.phases])
custom_fields = CustomField.where(resource: custom_forms)

CustomMaps::MapConfig.where(mappable: @project)
.or(CustomMaps::MapConfig.where(mappable: custom_fields))
.or(
CustomMaps::MapConfig.where(
mappable: CustomField.where(resource: CustomForm.where(participation_context: [@project, *@project.phases]))
)
)
end
end

0 comments on commit c588d1d

Please sign in to comment.