Compare commits

...

3 Commits

Author SHA1 Message Date
d6fd72a45c Merge pull request 'Fix duplicate row index on upsert statement' (#213) from fix-upsert-index into main
All checks were successful
Check usage of free licenses / check-licenses (push) Successful in 51s
Run unit tests / unit_tests (push) Successful in 1m48s
Build Nginx-based docker image / build-static-assets (push) Successful in 12m11s
Reviewed-on: #213
2025-01-14 22:11:43 +00:00
889485eaab Merge branch 'main' into fix-upsert-index
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m51s
Check usage of free licenses / check-licenses (pull_request) Successful in 1m9s
Run unit tests / unit_tests (pull_request) Successful in 3m18s
Build Nginx-based docker image / build-static-assets (pull_request) Successful in 15m7s
2025-01-14 21:08:36 +00:00
c6c5a87d8b Fix duplicate row index on upsert statement
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 1m22s
Run unit tests / unit_tests (pull_request) Successful in 2m59s
Build Nginx-based docker image / build-static-assets (pull_request) Failing after 8m46s
Check usage of free licenses / check-licenses (pull_request) Successful in 1m49s
2025-01-14 19:13:40 +01:00

View File

@ -26,7 +26,7 @@ class AffinitiesController < ApplicationController
} }
end end
GroupAffinity.upsert_all(affinities) GroupAffinity.upsert_all(affinities, unique_by: :uindex_group_pair)
render json: {}, status: :ok render json: {}, status: :ok
rescue ActiveRecord::InvalidForeignKey rescue ActiveRecord::InvalidForeignKey
@ -50,7 +50,7 @@ class AffinitiesController < ApplicationController
} }
end end
GroupAffinity.upsert_all(affinities) GroupAffinity.upsert_all(affinities, unique_by: :uindex_group_pair)
render json: {}, status: :ok render json: {}, status: :ok
end end