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

Fixed Product.in_taxon to not return duplicates #1962

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@laurens
Contributor

laurens commented Sep 13, 2012

When a product is assigned to a parent taxon and that parent’s child taxon, Product.in_taxon(taxon)should not return duplicate records.

radar added a commit that referenced this pull request Sep 17, 2012

radar added a commit that referenced this pull request Sep 17, 2012

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Sep 17, 2012

Member

This commit causes a build to break: http://travis-ci.org/#!/spree/spree/jobs/2483894. I will investigate.

Member

radar commented Sep 17, 2012

This commit causes a build to break: http://travis-ci.org/#!/spree/spree/jobs/2483894. I will investigate.

@radar

View changes

Show outdated Hide outdated core/spec/models/product/scopes_spec.rb
@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Sep 17, 2012

Member

I am going to revert this commit due to the broken build. I cannot figure out how to fix the broken spec.

Member

radar commented Sep 17, 2012

I am going to revert this commit due to the broken build. I cannot figure out how to fix the broken spec.

@laurens

This comment has been minimized.

Show comment
Hide comment
@laurens

laurens Sep 21, 2012

Contributor

I see, .uniq messes up the query of the price filter since the DISTINCT is added to the query in a wrong way.

Do you think, using .select("DISTINCT(spree_products.id), spree_products.*") instead of .uniq would be an alternative?

Contributor

laurens commented Sep 21, 2012

I see, .uniq messes up the query of the price filter since the DISTINCT is added to the query in a wrong way.

Do you think, using .select("DISTINCT(spree_products.id), spree_products.*") instead of .uniq would be an alternative?

@radar radar closed this in 8a303e1 Oct 18, 2012

radar added a commit that referenced this pull request Oct 18, 2012

Fix multiple products from appearing when using Product.in_taxons scope
Fixes #1917

Fixes #1974

Fixes #1962

Conflicts:

	core/app/models/spree/product/scopes.rb
	core/spec/models/product/scopes_spec.rb

radar added a commit that referenced this pull request Oct 18, 2012

Fix multiple products from appearing when using Product.in_taxons scope
Fixes #1917

Fixes #1974

Fixes #1962

Conflicts:

	core/app/models/spree/product/scopes.rb
	core/spec/models/product/scopes_spec.rb
@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Oct 18, 2012

Member

Yes, that appears to work. I've merged this PR to master, 1-2-stable and 1-1-stable. Thanks!

Member

radar commented Oct 18, 2012

Yes, that appears to work. I've merged this PR to master, 1-2-stable and 1-1-stable. Thanks!

@laurens laurens deleted the laurens:fix_for_in_taxon branch Jan 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment