README.md in tori-0.0.4 vs README.md in tori-0.0.5

- old
+ new

@@ -22,10 +22,18 @@ app/models/photo.rb ```ruby class Photo < ActiveRecord::Base tori :image + + after_save do + image.write if image.from? + end + + after_destroy do + image.delete + end end ``` app/controllers/photos_controller.rb @@ -59,19 +67,19 @@ You can read file. ```ruby photo.image.read #=> image bin photo.image.exist? #=> exist check -photo.image.to_s #=> filename +photo.image.name #=> filename ``` # Custom configure example ```ruby # Save to S3 bucket. require 'tori/backend/s3' -Tori.config.backend = Tori::Backend::S3.new('tori_bucket') +Tori.config.backend = Tori::Backend::S3.new(bucket: 'tori_bucket') # Filename decided by model.class.name,id and hidden words. Tori.config.filename_callback do |model| "#{model.class.name}/#{Digest::SHA1.hexdigest "#{ENV["TORI_MAGICKWORD"]}/#{model.id}"}" end @@ -80,9 +88,5 @@ # Default configure [https://github.com/ksss/tori/blob/master/lib/tori.rb](https://github.com/ksss/tori/blob/master/lib/tori.rb) You can change configure any time. - -# future TODO - -- support background S3 Storage