Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/dragonfly/google_data_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(opts)
def write(object, opts = {})
ensure_bucket_exists

uid = opts[:path] || Dragonfly::GoogleDataStore.generate_uid
uid = opts[:path] || Dragonfly::GoogleDataStore.generate_uid(object.name || 'file')

bucket.create_file object.tempfile.path, uid, metadata: object.meta

Expand All @@ -40,8 +40,8 @@ def destroy(uid)
nil
end

def self.generate_uid
"#{Time.now.strftime('%Y/%m/%d/%H/%M')}/#{SecureRandom.uuid}"
def self.generate_uid(name)
"#{Time.now.strftime('%Y/%m/%d/%H/%M')}/#{SecureRandom.uuid}/#{name}"
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/dragonfly/google_data_store/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Dragonfly
class GoogleDataStore
VERSION = "1.0.0"
VERSION = "1.0.1"
end
end