Skip to content

Instantly share code, notes, and snippets.

@Wendersonandes
Last active November 29, 2017 15:30
Show Gist options
  • Save Wendersonandes/0ee0c6feec100f877f3d4c64e14b6773 to your computer and use it in GitHub Desktop.
Save Wendersonandes/0ee0c6feec100f877f3d4c64e14b6773 to your computer and use it in GitHub Desktop.
Config Shrine to use File System
Shrine.storages = {
cache: Shrine::Storage::FileSystem.new("public", prefix: "uploads/cache"),
store: Shrine::Storage::FileSystem.new("public", prefix: "uploads/store"),
}
Shrine.plugin :activerecord
Shrine.plugin :logging, logger: Rails.logger
Shrine.plugin :backgrounding
Shrine::Attacher.promote { |data| UploadJob.perform_async(data) }
Shrine::Attacher.delete { |data| DeleteJob.perform_async(data) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment