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

Re-enable ActiveRecord lock! functionality #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexagranov
Copy link

lock just delegates to lock! so adding a spec showing that ActiveRecord::Locking::Pessimistic#lock! is broken.

The problem is in the reimplementation of reload which calls lock but this returns a Relation not the ActiveRecord class so the overridden find(*args) that can handle {no_obfuscated_id: true} never gets called.

I went with just removing the options hash from the call to Relation#find as it doesn't appear it would be used while locking anyway.

@alexagranov
Copy link
Author

@namick CI is failing due to broken 1.9.3 build

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

Successfully merging this pull request may close these issues.

1 participant