-
Notifications
You must be signed in to change notification settings - Fork 368
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
Fix return value of subscribed_task_stats #856
Conversation
hey, @fabiormoura thanks for the fix, PR looks good, but, could you please provide a spec for the |
Also, please provide a changelog entry, so that will be easier to generate a release (example) |
cd77ba2
to
f16488b
Compare
@@ -4,6 +4,8 @@ | |||
|
|||
### New Features | |||
|
|||
* [#856](https://github.com/toptal/chewy/pull/856): Fix return value of subscribed_task_stats used in rake tasks. ([@fabiormoura][]) | |||
|
|||
### Changes | |||
|
|||
### Bugs Fixed |
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 would say it's a bug fix, rather than a new feature :)
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.
It was because I haven't noticed there was a specific section in this file for bug fixes but thanks for approving the PR with this small mistake.
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.
this has been resolved.
@fabiormoura could you please fix rubocop offenses as well? Thanks |
it's been fixed. |
Merged, going to release it on Monday. Thanks for PR :) |
The method
subscribed_task_stats
wraps almost all methods in RakeHelper but it has a bug.For instance, the
upgrade
method in the same module is supposed to return a list of changed indexes inchewy/lib/chewy/rake_helper.rb
Lines 65 to 85 in 7d56754
However, the wrapping method isn't returning to the caller the value of
changed_indexes
. Instead, it returns the result of the methodoutput.puts
which isnil
.I'm simply moving
output.puts
to be called withinensure
so the output of the method correctly returns the result of:that would resolve to the correct value in the end when
&block
is evaluated.Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).