Class: Users::MigrateRecordsToGhostUserService
- Inherits:
-
Object
- Object
- Users::MigrateRecordsToGhostUserService
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/services/users/migrate_records_to_ghost_user_service.rb
Constant Summary collapse
- DestroyError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#ghost_user ⇒ Object
readonly
Returns the value of attribute ghost_user.
-
#hard_delete ⇒ Object
readonly
Returns the value of attribute hard_delete.
-
#initiator_user ⇒ Object
readonly
Returns the value of attribute initiator_user.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #execute(hard_delete: false) ⇒ Object
-
#initialize(user, initiator_user, execution_tracker) ⇒ MigrateRecordsToGhostUserService
constructor
A new instance of MigrateRecordsToGhostUserService.
Constructor Details
#initialize(user, initiator_user, execution_tracker) ⇒ MigrateRecordsToGhostUserService
Returns a new instance of MigrateRecordsToGhostUserService.
17 18 19 20 21 22 |
# File 'app/services/users/migrate_records_to_ghost_user_service.rb', line 17 def initialize(user, initiator_user, execution_tracker) @user = user @initiator_user = initiator_user @execution_tracker = execution_tracker @ghost_user = Users::Internal.ghost end |
Instance Attribute Details
#ghost_user ⇒ Object (readonly)
Returns the value of attribute ghost_user.
15 16 17 |
# File 'app/services/users/migrate_records_to_ghost_user_service.rb', line 15 def ghost_user @ghost_user end |
#hard_delete ⇒ Object (readonly)
Returns the value of attribute hard_delete.
15 16 17 |
# File 'app/services/users/migrate_records_to_ghost_user_service.rb', line 15 def hard_delete @hard_delete end |
#initiator_user ⇒ Object (readonly)
Returns the value of attribute initiator_user.
15 16 17 |
# File 'app/services/users/migrate_records_to_ghost_user_service.rb', line 15 def initiator_user @initiator_user end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
15 16 17 |
# File 'app/services/users/migrate_records_to_ghost_user_service.rb', line 15 def user @user end |
Instance Method Details
#execute(hard_delete: false) ⇒ Object
24 25 26 27 28 29 |
# File 'app/services/users/migrate_records_to_ghost_user_service.rb', line 24 def execute(hard_delete: false) @hard_delete = hard_delete migrate_records post_migrate_records end |