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:



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

delegate :[], to: :registry

#[]=Object

Alias for Registry#[]=

Returns:

  • (Object)

    Registry#[]=

See Also:



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

delegate :[]=, to: :registry

#deleteObject

Alias for Registry#delete

Returns:

  • (Object)

    Registry#delete

See Also:



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

delegate :delete, to: :registry

#registryObject



125
126
127
# File 'app/models/upload.rb', line 125

def registry
  self.store ||= {}
end