Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecords, UUIDs and Delayed Job #20

Open
cmaion opened this issue Jan 21, 2010 · 1 comment
Open

ActiveRecords, UUIDs and Delayed Job #20

cmaion opened this issue Jan 21, 2010 · 1 comment

Comments

@cmaion
Copy link

cmaion commented Jan 21, 2010

I'm moving some AR models to UUID's, instead of auto incremental ID's.
Delayed Job stopped working with that kind of model.

Turns out that the AR_STRING_FORMAT regex used to find the ActiveRecord object assumes that their primary key (id) is made of digits only... which is incorrect when moving to UUID (mix of letters, digits and -).

Fixed it for myself, with the following change in performable_method.rb:

instead of:
AR_STRING_FORMAT = /^AR:([A-Z][\w:]+):(\d+)$/
use:
AR_STRING_FORMAT = /^AR:([A-Z][\w:]+):([\w-]+)$/

@mikezaschka
Copy link

Stumbled across the same problem today.
Thanks for sharing!

latentflip pushed a commit to latentflip/delayed_job that referenced this issue Sep 9, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants