Permalink
Browse files

removed unnecessary prefixes (AR: and CLASS:)

  • Loading branch information...
elado committed Aug 18, 2012
1 parent 8585312 commit 0559df1eecc91f3c19655047952f23bc2a2e1ff5
@@ -36,7 +36,7 @@ def delay_for(interval)
end
def sidekiq_serialize
- "SIDEKIQ:AR@#{self.class.name}@#{self.id}"
+ "SIDEKIQ@#{self.class.name}@#{self.id}"
end
end
@@ -1,8 +1,7 @@
module Sidekiq
module Extensions
class ArgsSerializer
- # inspired by DelayedJob
- SIDEKIQ_CUSTOM_SERIALIZATION_FORMAT = /\ASIDEKIQ\:(?:\w+)@(.+)/
+ SIDEKIQ_CUSTOM_SERIALIZATION_FORMAT = /\ASIDEKIQ@(.+)/
def self.serialize(obj)
if obj.respond_to?(:sidekiq_serialize)
@@ -27,7 +27,7 @@ def delay_for(interval)
end
def sidekiq_serialize
- "SIDEKIQ:CLASS@#{self.name}"
+ "SIDEKIQ@#{self.name}"
end
end
@@ -24,13 +24,13 @@ class User < ActiveRecord::Base
end
it 'serializes active record class' do
- assert_equal "SIDEKIQ:CLASS@TestArgsSerializer::User", ser(User)
+ assert_equal "SIDEKIQ@TestArgsSerializer::User", ser(User)
assert_equal TestArgsSerializer::User, deser(ser(User))
end
it 'serializes active record instance' do
user = User.create!
- assert_equal "SIDEKIQ:AR@TestArgsSerializer::User@#{user.id}", ser(user)
+ assert_equal "SIDEKIQ@TestArgsSerializer::User@#{user.id}", ser(user)
assert_equal user, deser(ser(user))
end
@@ -41,12 +41,12 @@ module SomeModule
end
it 'serializes class' do
- assert_equal "SIDEKIQ:CLASS@TestArgsSerializer::SomeClass", ser(SomeClass)
+ assert_equal "SIDEKIQ@TestArgsSerializer::SomeClass", ser(SomeClass)
assert_equal SomeClass, deser(ser(SomeClass))
end
it 'serializes module' do
- assert_equal "SIDEKIQ:CLASS@TestArgsSerializer::SomeModule", ser(SomeModule)
+ assert_equal "SIDEKIQ@TestArgsSerializer::SomeModule", ser(SomeModule)
assert_equal SomeModule, deser(ser(SomeModule))
end

0 comments on commit 0559df1

Please sign in to comment.