Skip to content

Commit 8208bdf

Browse files
use SecureRandom.hex instead of uuid for shorter IDs
1 parent 2b8d7f3 commit 8208bdf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/taskinator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def options=(opts)
5050
end
5151

5252
def generate_uuid
53-
SecureRandom.uuid
53+
SecureRandom.hex(10)
5454
end
5555

5656
##

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class ApplicationJob < ActiveJob::Base
7474
end
7575

7676
config.before(:each, :redis => true) do
77-
Taskinator.redis = { :namespace => "taskinator:test:#{SecureRandom.uuid}" }
77+
Taskinator.redis = { :namespace => "taskinator:test:#{SecureRandom.hex(4)}" }
7878
end
7979

8080
config.before(:each, :sidekiq => true) do

spec/support/mock_definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def create(queue=nil)
1414
definition.queue = queue
1515

1616
# create a constant, so that the mock definition isn't anonymous
17-
Object.const_set("Mock#{SecureRandom.hex}Definition", definition)
17+
Object.const_set("Mock#{SecureRandom.hex(4)}Definition", definition)
1818

1919
end
2020
end

0 commit comments

Comments
 (0)