Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

0.70 fix for on_hand scope including products with 0 on hand #1082

Closed
wants to merge 1 commit into from

2 participants

Adam Crownoble Ryan Bigg
Adam Crownoble

The product on_hand scope was querying "count_on_hand >= 0" instead of "count_on_hand > 0".

I know 1.0 is getting most of the attention these days but since 0.70 is still the stable branch, and this seems like a significant bug, I thought it would be worth fixing.

Adam Crownoble adamcrown Fix on_hand scope including products with 0 avail.
The product on_hand scope was pulling "count_on_hand >= 0" instead of "count_on_hand > 0"
ef4f80e
Ryan Bigg
Collaborator

Would you be able to write a test for this as well please?

Ryan Bigg radar closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 3, 2012
  1. Adam Crownoble

    Fix on_hand scope including products with 0 avail.

    adamcrown authored
    The product on_hand scope was pulling "count_on_hand >= 0" instead of "count_on_hand > 0"
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  core/app/models/product.rb
2  core/app/models/product.rb
View
@@ -90,7 +90,7 @@ def active
end
def on_hand
- where(Product.arel_table[:count_on_hand].gteq(0))
+ where(Product.arel_table[:count_on_hand].gt(0))
end
def id_equals(input_id)
Something went wrong with that request. Please try again.