-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add arbitrary lock on class level too #499
Add arbitrary lock on class level too #499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pandwoter This is a great start.
I noticed that you created a new method called .with_advisory_record_lock
. I'd like the key:
parameter added to the existing .with_advisory_lock
class method. e.g. "it can be passed a column or a key" It's going to arguably overload it, but I don't want to introduce another method.
And I'm glad that you added additional .advisory_record_lock
and advisory_record_unlock
methods. I'd like those all to be renamed .advisory_lock
so that they are symmetrical with the instance methods.
Also, I think an additional refactor, once the class methods are dialed in, is to have the instance methods delegate to the class methods where possible.
Thank you!
Done! ✅
Yeah, I named this method like so due that we already have good_job/lib/good_job/lockable.rb Line 40 in 68fb960
Done ✅ Any thoughts regarding these scopes @bensheldon? To have exact same interface on a class and instance level we need to do something with it... |
I think what we have right now is mergable; it accomplishes what I set out. You do surface an issue of there are several methods to overload. I'm thinking:
|
🎉 |
#341