-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow to pass a lambda function to sequence initial value #1434
Conversation
Thanks for the PR. This is an interesting idea. Can you provide some more detail on when this would be useful? For the |
end | ||
end | ||
|
||
def first_value |
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.
Calling the block again when we rewind
means that rewinding will not bring us back to the value we started at. This sort of goes against why we introduced the feature to rewind sequences - it was for people who were relying on specific ids in their tests for one reason or another.
If we go forward with this feature, I think we will need some additional test coverage around how this works with rewinding sequences.
Thanks you @composerinteralia for your comments. I review them ASAP, I do not have time these days.... |
Thanks for the response. ASAP is not necessary at all. This PR isn't going anywhere, so please take your time. |
Hi @javierav - are you still interested in working on this, or should we close this PR? If you're still planning on working on this within the next few months, we'll keep it open, but if you no longer have the time to commit we can close it. Thank you! |
Hi @javierav - since there hasn't been activity on this PR since August, I'm going to close it. If you find you have time in the future to revisit, please feel free to reopen or open a new PR! |
You can change the existing sequence in the registry itself:
|
This merge allow us to pass a lambda function as the initial value of sequence. This lambda will be called the first time that is used (lazy load). For example: