Class: Nochmal::Reupload

Inherits:
Object
  • Object
show all
Defined in:
lib/nochmal/reupload.rb

Overview

Handles Reuploading of all attachments from: (required) = ActiveStorage service name (e.g. local) to: (optional) = ActiveStorage service name (e.g. aws) if left empty,

the currently configured service will be used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from: nil, to: nil, helper: nil) ⇒ Reupload

Returns a new instance of Reupload.



11
12
13
14
# File 'lib/nochmal/reupload.rb', line 11

def initialize(from: nil, to: nil, helper: nil)
  @active_storage = helper || Adapters::ActiveStorage.new(from: from, to: to)
  @notes = []
end

Instance Attribute Details

#active_storageObject (readonly)

Returns the value of attribute active_storage.



9
10
11
# File 'lib/nochmal/reupload.rb', line 9

def active_storage
  @active_storage
end

#from_serviceObject (readonly)

Returns the value of attribute from_service.



9
10
11
# File 'lib/nochmal/reupload.rb', line 9

def from_service
  @from_service
end

#to_serviceObject (readonly)

Returns the value of attribute to_service.



9
10
11
# File 'lib/nochmal/reupload.rb', line 9

def to_service
  @to_service
end

Instance Method Details

#allObject



16
17
18
# File 'lib/nochmal/reupload.rb', line 16

def all
  handle_each_model(:reupload)
end

#countObject



24
25
26
# File 'lib/nochmal/reupload.rb', line 24

def count
  handle_each_model(:count)
end

#listObject



20
21
22
# File 'lib/nochmal/reupload.rb', line 20

def list
  handle_each_model(:list)
end