Class: Gitlab::ImportExport::AvatarRestorer
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::AvatarRestorer
- Includes:
- Import::Framework::ProgressTracking
- Defined in:
- lib/gitlab/import_export/avatar_restorer.rb
Constant Summary
Constants included from Import::Framework::ProgressTracking
Import::Framework::ProgressTracking::CACHE_EXPIRATION
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
-
#initialize(project:, shared:) ⇒ AvatarRestorer
constructor
A new instance of AvatarRestorer.
- #restore ⇒ Object
Methods included from Import::Framework::ProgressTracking
#processed_entry?, #save_processed_entry, #with_progress_tracking
Constructor Details
#initialize(project:, shared:) ⇒ AvatarRestorer
Returns a new instance of AvatarRestorer.
10 11 12 13 |
# File 'lib/gitlab/import_export/avatar_restorer.rb', line 10 def initialize(project:, shared:) @project = project @shared = shared end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/gitlab/import_export/avatar_restorer.rb', line 8 def project @project end |
Instance Method Details
#restore ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gitlab/import_export/avatar_restorer.rb', line 15 def restore return true unless avatar_export_file with_progress_tracking(**) do @project.avatar = File.open(avatar_export_file) @project.save! end rescue StandardError => e @shared.error(e) false end |