Class: Upload::CurrentPaths

Inherits:
ActiveSupport::CurrentAttributes
  • Object
show all
Defined in:
app/models/upload.rb

Overview

Request-scoped cache mapping upload IDs to local temp file paths.
Automatically reset at the start of each web request / Sidekiq job.
Allows freshly loaded instances (e.g. via includes) to reuse files
already on disk, avoiding redundant S3 round-trips.

Delegated Instance Attributes collapse

Instance Method Summary collapse

Instance Method Details

#[]Object

Alias for Registry#[]

Returns:

  • (Object)

    Registry#[]

See Also:



116
# File 'app/models/upload.rb', line 116

delegate :[], to: :registry

#[]=Object

Alias for Registry#[]=

Returns:

  • (Object)

    Registry#[]=

See Also:



118
# File 'app/models/upload.rb', line 118

delegate :[]=, to: :registry

#deleteObject

Alias for Registry#delete

Returns:

  • (Object)

    Registry#delete

See Also:



120
# File 'app/models/upload.rb', line 120

delegate :delete, to: :registry

#registryObject



112
113
114
# File 'app/models/upload.rb', line 112

def registry
  self.store ||= {}
end