Skip to content

Re-enable ActiveRecord lock! functionality#54

Open
alexagranov wants to merge 1 commit intonamick:masterfrom
alexagranov:fix_locking
Open

Re-enable ActiveRecord lock! functionality#54
alexagranov wants to merge 1 commit intonamick:masterfrom
alexagranov:fix_locking

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