Class: Sibu::ImageUploader

Inherits:
Shrine
  • Object
show all
Includes:
ImageProcessing::MiniMagick
Defined in:
app/models/concerns/sibu/image_uploader.rb

Instance Method Summary collapse

Instance Method Details

#generate_location(io, context) ⇒ Object



25
26
27
28
29
30
31
# File 'app/models/concerns/sibu/image_uploader.rb', line 25

def generate_location(io, context)
  user_id = context[:record] ? context[:record].user_id : nil
  style = context[:version] != :original ? "resized" : "originals"
  name = super

  [user_id, style, name].compact.join("/")
end