lib/tori.rb in tori-0.0.3 vs lib/tori.rb in tori-0.0.4
- old
+ new
@@ -16,13 +16,18 @@
# Recommend to create config/initializer/tori.rb for setting.
# Configure for file store backend instance.
config.backend = Tori::Backend::FileSystem.new(Pathname("tmp/tori"))
+ # You can also use S3 backend.
+ # It take 'aws-sdk' gem.
+ # S3 example
+ # require 'tori/backend/s3'
+ # config.backend = Tori::Backend::S3.new('tori_bucket')
+
# Filename hashing method
# It's call when decide filename hash.
- # `filename_callback` must be have `call` method.
- config.filename_callback = ->(model) do
+ config.filename_callback do |model|
Digest::SHA1.hexdigest "#{model.class.name}/#{model.id}"
end
end
end
end