Source: show | on GitHub
# File lib/carrierwave/storage/grid_fs.rb, line 15 def initialize(uploader, database, path) @database = database @path = path @uploader = uploader end
# File lib/carrierwave/storage/grid_fs.rb, line 41 def content_type ::GridFS::GridStore.open(@database, @path, 'r') { |f| return f.content_type } end
# File lib/carrierwave/storage/grid_fs.rb, line 37 def delete ::GridFS::GridStore.unlink(@database, @path) end
# File lib/carrierwave/storage/grid_fs.rb, line 21 def path nil end
# File lib/carrierwave/storage/grid_fs.rb, line 33 def read ::GridFS::GridStore.read(@database, @path) end
# File lib/carrierwave/storage/grid_fs.rb, line 25 def url unless @uploader.grid_fs_access_url nil else [@uploader.grid_fs_access_url, @path].join("/") end end