diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-09 15:12:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-09 15:12:15 +0300 |
commit | b808458daa86105dd2101893961338912961ee92 (patch) | |
tree | 5a3b432668a2340cced92eeaa2654604ba0efef9 /app/services/bulk_update_integration_service.rb | |
parent | 1aa9cd3080e7ef34b7b021f23222d3990e4a1128 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/bulk_update_integration_service.rb')
-rw-r--r-- | app/services/bulk_update_integration_service.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/bulk_update_integration_service.rb b/app/services/bulk_update_integration_service.rb index 45465ba3946..29c4d0cc220 100644 --- a/app/services/bulk_update_integration_service.rb +++ b/app/services/bulk_update_integration_service.rb @@ -12,7 +12,7 @@ class BulkUpdateIntegrationService Integration.where(id: batch_ids).update_all(integration_hash) if integration.data_fields_present? - integration.data_fields.class.where(service_id: batch_ids).update_all(data_fields_hash) + integration.data_fields.class.where(data_fields_foreign_key => batch_ids).update_all(data_fields_hash) end end end @@ -22,6 +22,11 @@ class BulkUpdateIntegrationService attr_reader :integration, :batch + # service_id or integration_id + def data_fields_foreign_key + integration.data_fields.class.reflections['integration'].foreign_key + end + def integration_hash integration.to_integration_hash.tap { |json| json['inherit_from_id'] = integration.inherit_from_id || integration.id } end |