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

Puts warn when Object#delay is called with block #2

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

Conversation

qpSHiNqp
Copy link
Owner

@qpSHiNqp qpSHiNqp commented Apr 20, 2023

変更内容

Object#delayがブロックとともに呼ばれたときに警告を出すようにした。
結局、ProcやBlockはYAMLにシリアライズできないので、Jobにenqueueできないので...

背景

Article.first.delay.tap do |article|
  article.touch
end

をDelayedJobのバックエンドで実行すると、以下の例外がraiseされる。もともとblockはダメだって分かってるんだからwarnでも出しておくべきかと思った。

LocalJumpError: no block given

@qpSHiNqp qpSHiNqp requested a review from yamat47 April 20, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant