Class: WorkItems::DataSync::Widgets::AwardEmoji
- Inherits:
-
Base
- Object
- Issuable::Callbacks::Base
- Callbacks::Base
- Base
- WorkItems::DataSync::Widgets::AwardEmoji
- Defined in:
- app/services/work_items/data_sync/widgets/award_emoji.rb
Constant Summary
Constants inherited from Base
Constants inherited from Issuable::Callbacks::Base
Issuable::Callbacks::Base::Error
Instance Attribute Summary
Attributes inherited from Base
#current_user, #target_work_item, #work_item
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from Callbacks::Base
Methods inherited from Issuable::Callbacks::Base
#after_initialize, #after_save, #after_save_commit, #after_update, #after_update_commit, #before_create, #before_update, #initialize
Methods included from Gitlab::Allowable
Constructor Details
This class inherits a constructor from WorkItems::DataSync::Widgets::Base
Instance Method Details
#after_create ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'app/services/work_items/data_sync/widgets/award_emoji.rb', line 7 def after_create return unless params[:operation] == :move return unless target_work_item.(:award_emoji) work_item.award_emoji.each_batch(of: BATCH_SIZE) do |awards_batch| ::AwardEmoji.insert_all(new_work_item_award_emoji(awards_batch)) end end |
#post_move_cleanup ⇒ Object
16 17 18 19 20 |
# File 'app/services/work_items/data_sync/widgets/award_emoji.rb', line 16 def post_move_cleanup work_item.award_emoji.each_batch(of: BATCH_SIZE) do |award_emoji_batch| award_emoji_batch.delete_all end end |