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
Use #prepend rather than using 2 aliases #19752
Use #prepend rather than using 2 aliases #19752
Conversation
This is required to run rails#19752 successfully.
783acaf
to
93078ca
Compare
For some reason the build status didn't show up here, but it's green ✅ on travis. |
Nice catch! Looks good for me. |
else | ||
include_without_range?(value) | ||
module ActiveSupport | ||
module IncludeWithRange |
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 think we should nodoc this constant as well, it will be weird to have it showing up in the docs.
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.
done.
93078ca
to
aa255a3
Compare
if value.is_a?(::Range) | ||
# 1...10 includes 1..9 but it does not include 1..10. | ||
operator = exclude_end? && !value.exclude_end? ? :< : :<= | ||
super(value.first) && value.last.send(operator, last) |
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.
Sorry, I just noticed it now, but this indent seems weird doesn't it?
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'm not sure, I'm happy to remove the line break here, though. WDYT?
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.
The second line has extra indent, I think it should be indented like this:
operator = exclude_end? && !value.exclude_end? ? :< : :<=
super(value.first) && value.last.send(operator, last)
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.
Thanks, I missed that. the commit has been updated.
aa255a3
to
d3684c4
Compare
Use #prepend rather than using 2 aliases
thanks! 💚💛❤️💙💜 |
This is a follow-up pull request to #19434. Now that Ruby 2.2.2 is out and we can use
#prepend
anywhere.cc/ @rafaelfranca @kirs