-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Code review #2679
Code review #2679
Conversation
HashNotAdam
commented
Jul 27, 2016
- Create better conformity to the style guide.
- Create compatibility with the Code Climate version of RuboCop to stop pull requests from being incorrectly labeled as failed.
- Add RuboCop ignores for constants that are being used a mutable items since adjusting this behaviour would require a lot of testing.
- DRY up some code seen in multiple places.
These methods are not aliases of each other and there are valid reasons for sometimes desiring alias_method
@@ -16,7 +16,7 @@ class PolymorphicAssociation < RailsAdmin::Config::Fields::Types::BelongsToAssoc | |||
# association checks that any of the child models are included in | |||
# configuration. | |||
register_instance_option :visible? do | |||
associated_model_config.length > 0 | |||
!associated_model_config.empty? |
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.
!empty? == any?
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.
I'll be honest with you... I didn't like this but also didn't take the time to look into what associated_model_config returned and so played it safe :)
Looking at it now, it seems like association.klass
should always return an array so it should be safe to use any?
I'll make this change now.
👍 |
Excellent work, thanks a lot! |
Wonderful, thank you, I'll rebase my other PRs now. |