Last active
November 29, 2017 15:30
-
-
Save Wendersonandes/0ee0c6feec100f877f3d4c64e14b6773 to your computer and use it in GitHub Desktop.
Config Shrine to use File System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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