Removed redundant returns #1116
| @@ -19,20 +19,16 @@ def display_human_quantity(harvest) | ||
| if harvest.unit == 'individual' # just the number | ||
| number_to_human(harvest.quantity, strip_insignificant_zeros: true) | ||
| elsif !harvest.unit.blank? # pluralize anything else | ||
| - return pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit) | ||
| + pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit) |
CloCkWeRX
Dec 5, 2016
Contributor
I'd be kind of inclined to refactor this method to return early, so theres less nested conditionals
return unless !harvest.quantity.blank? && harvest.quantity > 0
| end | ||
| - else | ||
| - return nil | ||
| end | ||
| end | ||
| def display_weight(harvest) | ||
| if !harvest.weight_quantity.blank? && harvest.weight_quantity > 0 |
| @@ -66,17 +66,17 @@ class Seed < ActiveRecord::Base | ||
| def tradable? | ||
| if self.tradable_to == 'nowhere' |
|
Mmm, those tests are being odd. I can't see how https://travis-ci.org/Growstuff/growstuff/jobs/181238816 is failing because of 5517139 alone. |
coveralls
commented
Dec 6, 2016
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.