You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There can only be one after_commit hook defined for a model. This, however, is pretty confusing in the light of the on: option and its abbreviations (after_create_commit, after_update_commit and after_destroy_commit). For example, the following examples all result in a single after_commit hook being defined:
Problem
There can only be one
after_commit
hook defined for a model. This, however, is pretty confusing in the light of theon:
option and its abbreviations (after_create_commit
,after_update_commit
andafter_destroy_commit
). For example, the following examples all result in a singleafter_commit
hook being defined:See also:
Interestingly enough, the following works
See also:
So the cop could recommend to only use this format.
Describe the solution you'd like
I'd like rubocop to be able to detect this scenario and only allow for one
after_commit
and its abbreviations per model.The text was updated successfully, but these errors were encountered: