mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-06 10:19:48 +00:00
18 lines
533 B
Ruby
18 lines
533 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Override the method to use Set instead of Array:
|
|
#
|
|
# https://github.com/rails/rails/blob/v7.1.5.1/activemodel/lib/active_model/attribute_methods.rb#L398
|
|
#
|
|
# Otherwise, the background migrations are very slow.
|
|
# Explanation: https://gitlab.com/gitlab-org/gitlab/-/issues/495067#note_2260634049
|
|
module ActiveModel
|
|
module AttributeMethods
|
|
module ClassMethods
|
|
def aliases_by_attribute_name
|
|
@aliases_by_attribute_name ||= Hash.new { |h, k| h[k] = Set.new }
|
|
end
|
|
end
|
|
end
|
|
end
|