Pattern: Wrong Active Record callback order
Issue: -
This rule checks that Active Record callbacks are declared in the order in which they will be executed.
# bad
class Person < ApplicationRecord
after_commit :after_commit_callback
before_validation :before_validation_callback
end
# good
class Person < ApplicationRecord
before_validation :before_validation_callback
after_commit :after_commit_callback
end