Class: Packages::UpdateTagsService
- Inherits:
-
Object
- Object
- Packages::UpdateTagsService
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/packages/update_tags_service.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(package, tags = []) ⇒ UpdateTagsService
constructor
A new instance of UpdateTagsService.
Constructor Details
#initialize(package, tags = []) ⇒ UpdateTagsService
Returns a new instance of UpdateTagsService.
6 7 8 9 |
# File 'app/services/packages/update_tags_service.rb', line 6 def initialize(package, = []) @package = package @tags = end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/services/packages/update_tags_service.rb', line 11 def execute return if @tags.empty? = - @tags = @tags - @package..with_name().delete_all if .any? ::ApplicationRecord.legacy_bulk_insert(Packages::Tag.table_name, rows()) if .any? # rubocop:disable Gitlab/BulkInsert end |