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



20
21
22
23
24
25
26
# File 'app/models/concerns/sibu/image_uploader.rb', line 20

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

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