-
-
Notifications
You must be signed in to change notification settings - Fork 263
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 new Rails/ActiveRecordCallbacksOrder
cop
#285
Merged
koic
merged 1 commit into
rubocop:master
from
fatkodima:active-record-callbacks-order-cop
Jul 14, 2020
Merged
Add new Rails/ActiveRecordCallbacksOrder
cop
#285
koic
merged 1 commit into
rubocop:master
from
fatkodima:active-record-callbacks-order-cop
Jul 14, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andyw8
reviewed
Jun 30, 2020
andyw8
reviewed
Jun 30, 2020
fatkodima
force-pushed
the
active-record-callbacks-order-cop
branch
from
June 30, 2020 18:47
1328643
to
b703739
Compare
andyw8
reviewed
Jul 1, 2020
fatkodima
force-pushed
the
active-record-callbacks-order-cop
branch
from
July 1, 2020 09:15
b703739
to
4501b02
Compare
koic
reviewed
Jul 14, 2020
koic
reviewed
Jul 14, 2020
The current implementation produces the following error. class User < ApplicationRecord
def do_something
end
end NoMethodError:
undefined method `send_type?' for :do_something:Symbol
# ./lib/rubocop/cop/rails/active_record_callbacks_order.rb:97:in `callback?'
# ./lib/rubocop/cop/rails/active_record_callbacks_order.rb:90:in `block in defined_callbacks'
# ./lib/rubocop/cop/rails/active_record_callbacks_order.rb:90:in `select'
# ./lib/rubocop/cop/rails/active_record_callbacks_order.rb:90:in `defined_callbacks'
# ./lib/rubocop/cop/rails/active_record_callbacks_order.rb:55:in `on_class' |
fatkodima
force-pushed
the
active-record-callbacks-order-cop
branch
from
July 14, 2020 10:24
4501b02
to
8335f41
Compare
Updated. Added a test case for failing example. |
Thanks! |
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://rails.rubystyle.guide/#callbacks-order
I always wanted to have a similar cop, and here it is 😄