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

Code review #2679

Merged
merged 32 commits into from Jul 29, 2016
Merged

Code review #2679

merged 32 commits into from Jul 29, 2016

Conversation

HashNotAdam
Copy link

  • 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.

Adam Rice added 30 commits July 27, 2016 11:25
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?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!empty? == any?

Copy link
Author

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.

@tiii
Copy link
Contributor

tiii commented Jul 28, 2016

👍

@mshibuya mshibuya merged commit eefa8ac into railsadminteam:master Jul 29, 2016
@mshibuya
Copy link
Member

Excellent work, thanks a lot!

@HashNotAdam
Copy link
Author

Wonderful, thank you, I'll rebase my other PRs now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants