Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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

@adamcrown

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.

@adamcrown 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
@radar
Collaborator

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

@radar 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. @adamcrown

    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
View
2  core/app/models/product.rb
@@ -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.