Class: Issuable::Clone::BaseService
- Inherits:
-
IssuableBaseService
- Object
- BaseContainerService
- BaseProjectService
- IssuableBaseService
- Issuable::Clone::BaseService
- Defined in:
- app/services/issuable/clone/base_service.rb
Direct Known Subclasses
AttributesRewriter, Issues::CloneService, Issues::MoveService
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.
-
#target_project ⇒ Object
readonly
Returns the value of attribute target_project.
Attributes inherited from BaseProjectService
Attributes inherited from BaseContainerService
#container, #current_user, #params
Instance Method Summary collapse
Methods inherited from BaseProjectService
Methods included from Gitlab::Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Methods inherited from BaseContainerService
#group_container?, #initialize, #namespace_container?, #project_container?
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 |
#target_project ⇒ Object (readonly)
Returns the value of attribute target_project.
6 7 8 |
# File 'app/services/issuable/clone/base_service.rb', line 6 def target_project @target_project end |
Instance Method Details
#execute(original_entity, target_project = nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/services/issuable/clone/base_service.rb', line 10 def execute(original_entity, target_project = nil) @original_entity = original_entity @target_project = target_project # Using transaction because of a high resources footprint # on rewriting notes (unfolding references) # ApplicationRecord.transaction do @new_entity = create_new_entity update_new_entity update_old_entity create_notes end end |