Use Set for aliases_by_attribute_name collection
It overrides the Rails method to use Set instead of an Array - https://github.com/rails/rails/blob/main/activemodel/lib/active_model/attribute_methods.rb#L383 In this case, when `alias_attribute` is called multiple times for the same attribute, the number doesn't grow.
显示
- Gemfile 1 个添加, 1 个删除Gemfile
- Gemfile.next.checksum 15 个添加, 14 个删除Gemfile.next.checksum
- Gemfile.next.lock 59 个添加, 55 个删除Gemfile.next.lock
- app/models/concerns/issuable.rb 1 个添加, 1 个删除app/models/concerns/issuable.rb
- app/models/note.rb 3 个添加, 1 个删除app/models/note.rb
- config/application.rb 1 个添加, 0 个删除config/application.rb
- config/initializers/active_model_attribute_methods.rb 19 个添加, 0 个删除config/initializers/active_model_attribute_methods.rb
- ee/spec/lib/ai/context/dependencies/config_files/ruby_gems_lock_spec.rb 1 个添加, 1 个删除.../context/dependencies/config_files/ruby_gems_lock_spec.rb
- lib/gitlab/patch/redis_cache_store.rb 1 个添加, 1 个删除lib/gitlab/patch/redis_cache_store.rb
- spec/initializers/active_model_attribute_methods_spec.rb 26 个添加, 0 个删除spec/initializers/active_model_attribute_methods_spec.rb
- spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb 7 个添加, 2 个删除...ioning_migration_helpers/table_management_helpers_spec.rb
- spec/lib/gitlab/diff/line_spec.rb 1 个添加, 1 个删除spec/lib/gitlab/diff/line_spec.rb
- spec/models/note_spec.rb 1 个添加, 1 个删除spec/models/note_spec.rb
- spec/support/shared_examples/csp.rb 1 个添加, 1 个删除spec/support/shared_examples/csp.rb
加载中
想要评论请 注册 或 登录