diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-19 21:10:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-19 21:10:34 +0300 |
commit | 9134da04883fb17a8636cddbd457210fa8f5ab38 (patch) | |
tree | 54bc4be56906752103f9054d8b52a2ca6620a878 /lib/gitlab/import_export | |
parent | 8cfe3415e91f4403ded9cc44066a0a459688a609 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/import_export')
-rw-r--r-- | lib/gitlab/import_export/base/relation_factory.rb | 26 | ||||
-rw-r--r-- | lib/gitlab/import_export/json/streaming_serializer.rb | 31 |
2 files changed, 29 insertions, 28 deletions
diff --git a/lib/gitlab/import_export/base/relation_factory.rb b/lib/gitlab/import_export/base/relation_factory.rb index bbec473d29d..b05d9cb2489 100644 --- a/lib/gitlab/import_export/base/relation_factory.rb +++ b/lib/gitlab/import_export/base/relation_factory.rb @@ -15,19 +15,19 @@ module Gitlab UNIQUE_RELATIONS = %i[].freeze USER_REFERENCES = %w[ - author_id - assignee_id - updated_by_id - merged_by_id - latest_closed_by_id - user_id - created_by_id - last_edited_by_id - merge_user_id - resolved_by_id - closed_by_id - owner_id - ].freeze + author_id + assignee_id + updated_by_id + merged_by_id + latest_closed_by_id + user_id + created_by_id + last_edited_by_id + merge_user_id + resolved_by_id + closed_by_id + owner_id + ].freeze TOKEN_RESET_MODELS = %i[Project Namespace Group Ci::Trigger Ci::Build Ci::Runner ProjectHook ErrorTracking::ProjectErrorTrackingSetting].freeze diff --git a/lib/gitlab/import_export/json/streaming_serializer.rb b/lib/gitlab/import_export/json/streaming_serializer.rb index 99396d64779..cf62f181366 100644 --- a/lib/gitlab/import_export/json/streaming_serializer.rb +++ b/lib/gitlab/import_export/json/streaming_serializer.rb @@ -175,21 +175,22 @@ module Gitlab order_expression = arel_table[column].public_send(direction).public_send(nulls_position) # rubocop:disable GitlabSecurity/PublicSend reverse_order_expression = arel_table[column].public_send(reverse_direction).public_send(reverse_nulls_position) # rubocop:disable GitlabSecurity/PublicSend - ::Gitlab::Pagination::Keyset::Order.build([ - ::Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( - attribute_name: column, - column_expression: arel_table[column], - order_expression: order_expression, - reversed_order_expression: reverse_order_expression, - order_direction: direction, - nullable: nulls_position, - distinct: false - ), - ::Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( - attribute_name: klass.primary_key, - order_expression: arel_order_classes[direction].new(arel_table[klass.primary_key.to_sym]) - ) - ]) + ::Gitlab::Pagination::Keyset::Order.build( + [ + ::Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( + attribute_name: column, + column_expression: arel_table[column], + order_expression: order_expression, + reversed_order_expression: reverse_order_expression, + order_direction: direction, + nullable: nulls_position, + distinct: false + ), + ::Gitlab::Pagination::Keyset::ColumnOrderDefinition.new( + attribute_name: klass.primary_key, + order_expression: arel_order_classes[direction].new(arel_table[klass.primary_key.to_sym]) + ) + ]) end def read_from_replica_if_available(&block) |