Class: WorkItems::DataSync::Widgets::Base
- Inherits:
-
Callbacks::Base
- Object
- Issuable::Callbacks::Base
- Callbacks::Base
- WorkItems::DataSync::Widgets::Base
- Defined in:
- app/services/work_items/data_sync/widgets/base.rb
Direct Known Subclasses
Assignees, AwardEmoji, CrmContacts, CurrentUserTodos, Description, Designs, Development, EmailParticipants, ErrorTracking, Hierarchy, Labels, LinkedItems, LinkedResources, Milestone, Notes, Notifications, Participants, StartAndDueDate, TimeTracking
Constant Summary collapse
- BATCH_SIZE =
100
Constants inherited from Issuable::Callbacks::Base
Issuable::Callbacks::Base::Error
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#target_work_item ⇒ Object
readonly
Returns the value of attribute target_work_item.
-
#work_item ⇒ Object
readonly
Returns the value of attribute work_item.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(work_item:, target_work_item:, current_user:, params: {}) ⇒ Base
constructor
A new instance of Base.
-
#post_move_cleanup ⇒ Object
IMPORTANT: This is a callback that is called by
BaseCleanupDataServicefromDataSync::MoveServiceafter the work item is moved to the target namespace to delete the original work item data. - #raise_error!(message) ⇒ Object
Methods inherited from Callbacks::Base
Methods inherited from Issuable::Callbacks::Base
#after_create, #after_initialize, #after_save, #after_save_commit, #after_update, #after_update_commit, #before_create, #before_update, execute_without_params?
Methods included from Gitlab::Allowable
Constructor Details
#initialize(work_item:, target_work_item:, current_user:, params: {}) ⇒ Base
Returns a new instance of Base.
15 16 17 18 19 20 |
# File 'app/services/work_items/data_sync/widgets/base.rb', line 15 def initialize(work_item:, target_work_item:, current_user:, params: {}) @work_item = work_item @target_work_item = target_work_item @current_user = current_user @params = params end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
7 8 9 |
# File 'app/services/work_items/data_sync/widgets/base.rb', line 7 def current_user @current_user end |
#target_work_item ⇒ Object (readonly)
Returns the value of attribute target_work_item.
7 8 9 |
# File 'app/services/work_items/data_sync/widgets/base.rb', line 7 def target_work_item @target_work_item end |
#work_item ⇒ Object (readonly)
Returns the value of attribute work_item.
7 8 9 |
# File 'app/services/work_items/data_sync/widgets/base.rb', line 7 def work_item @work_item end |
Class Method Details
Instance Method Details
#post_move_cleanup ⇒ Object
IMPORTANT: This is a callback that is called by BaseCleanupDataService from DataSync::MoveService after the work item is moved to the target namespace to delete the original work item data. That is because we have to implement MoveService as copy to destination & delete from source.
Has to be implemented in the specific widget class or it can be an empty implementation if it does not need to cleanup any data on the original work item
32 |
# File 'app/services/work_items/data_sync/widgets/base.rb', line 32 def post_move_cleanup; end |