diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-01 14:24:50 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-01 14:24:50 +0200 |
commit | a9d2ce5d18288223fce5a8095c2fb37520017828 (patch) | |
tree | daa886df9f6478a2178217b40e3a1bc5dfb5642b | |
parent | 1e05e6285602656bc3504b83d03135c343cd50e6 (diff) | |
download | rails-a9d2ce5d18288223fce5a8095c2fb37520017828.tar.gz rails-a9d2ce5d18288223fce5a8095c2fb37520017828.tar.bz2 rails-a9d2ce5d18288223fce5a8095c2fb37520017828.zip |
Breathing room
-rw-r--r-- | lib/active_file/sites/disk_site.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/active_file/sites/disk_site.rb b/lib/active_file/sites/disk_site.rb index 2bf80d07f4..d61b6c3c5d 100644 --- a/lib/active_file/sites/disk_site.rb +++ b/lib/active_file/sites/disk_site.rb @@ -8,6 +8,7 @@ class ActiveFile::Sites::DiskSite < ActiveFile::Site @root = root end + def upload(key, data) File.open(make_path_for(key), "wb") do |file| while chunk = data.read(65536) @@ -45,6 +46,7 @@ class ActiveFile::Sites::DiskSite < ActiveFile::Site Digest::MD5.file(path_for(key)).hexdigest end + private def path_for(key) File.join root, folder_for(key), key |