Class: Gitlab::ImportExport::AvatarRestorer
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::AvatarRestorer
- Defined in:
- lib/gitlab/import_export/avatar_restorer.rb
Instance Method Summary collapse
-
#initialize(project:, shared:) ⇒ AvatarRestorer
constructor
A new instance of AvatarRestorer.
- #restore ⇒ Object
Constructor Details
#initialize(project:, shared:) ⇒ AvatarRestorer
Returns a new instance of AvatarRestorer.
6 7 8 9 |
# File 'lib/gitlab/import_export/avatar_restorer.rb', line 6 def initialize(project:, shared:) @project = project @shared = shared end |
Instance Method Details
#restore ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/gitlab/import_export/avatar_restorer.rb', line 11 def restore return true unless avatar_export_file @project.avatar = File.open(avatar_export_file) @project.save! rescue StandardError => e @shared.error(e) false end |