Class: Issuable::Clone::BaseService
- Inherits:
-
IssuableBaseService
- Object
- BaseContainerService
- IssuableBaseService
- Issuable::Clone::BaseService
- Defined in:
- app/services/issuable/clone/base_service.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#new_entity ⇒ Object
readonly
Returns the value of attribute new_entity.
-
#original_entity ⇒ Object
readonly
Returns the value of attribute original_entity.
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
Methods inherited from BaseContainerService
#group_container?, #initialize, #namespace_container?, #project_container?, #project_group, #root_ancestor
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Instance Attribute Details
#new_entity ⇒ Object (readonly)
Returns the value of attribute new_entity.
6 7 8 |
# File 'app/services/issuable/clone/base_service.rb', line 6 def new_entity @new_entity end |
#original_entity ⇒ Object (readonly)
Returns the value of attribute original_entity.
6 7 8 |
# File 'app/services/issuable/clone/base_service.rb', line 6 def original_entity @original_entity end |
Instance Method Details
#execute(original_entity, target_parent) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/issuable/clone/base_service.rb', line 10 def execute(original_entity, target_parent) @original_entity = original_entity @target_parent = target_parent # Using transaction because of a high resources footprint # on rewriting notes (unfolding references) ApplicationRecord.transaction do @new_entity = create_new_entity @new_entity. = nil update_new_entity update_old_entity create_notes after_clone_actions end end |