Skip to content
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

Deprecate weird taxon product filters #2408

Merged
merged 2 commits into from
Dec 20, 2017

Conversation

cbrunsdon
Copy link
Contributor

@cbrunsdon cbrunsdon commented Nov 28, 2017

This doesn't look like these were ever used, and I can't imagine anyone
finding them randomly and using them.

Better to pull these out of core and let people add it themselves if they
want it.

Also, they're untested.

This doesn't look like it was ever used, and I can't imagine anyone
finding it randomly and using it.

Better to pull it out of core and let people add it themselves if they
want it.

Also, its untested.
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, kill it. The I19n, as well: name: 'Taxons under ' ...

@cbrunsdon
Copy link
Contributor Author

@kennyadsl @mamhoff I threw another commit on here before I saw your approval. I can either split this up into another PR or you can weigh in on it being okay.

@cbrunsdon cbrunsdon changed the title Deprecate taxons_below Deprecate weird taxon product filters Nov 28, 2017
return Spree::Core::ProductFilters.all_taxons if taxon.nil?
{
name: 'Taxons under ' + taxon.name,
scope: :taxons_id_in_tree_any,
labels: taxon.children.sort_by(&:position).map { |t| [t.name, t.id] },
scope: :taxons_id_in_tree_any, labels: taxon.children.sort_by(&:position).map { |t| [t.name, t.id] },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep it on 2 lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, sorry. fixed

I can't find any reasonable circumstance this (untested) method would
ever ran in.

These are all very difficult to understand or use, but would be easy for
host applications to add in themselves if they wanted to continue using
them.
@cbrunsdon cbrunsdon force-pushed the deprecate_taxons_below branch from 95c1257 to fff13ea Compare November 28, 2017 15:48
@@ -1,4 +1,4 @@
<% filters = @taxon ? @taxon.applicable_filters : [Spree::Core::ProductFilters.all_taxons] %>
<% filters = @taxon.applicable_filters %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this partial is or was rendered in some view that doesn't have @taxon?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not anywhere in solidus_frontend, the only time its rendered I can find is here:

https://github.com/solidusio/solidus/blob/master/frontend/app/views/spree/products/index.html.erb#L1-L9

And in that case only if @taxon exists.

I personally have a vendetta against these methods because I only barely understand what is happening and don't think they're used or valuable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, seems like it's safe to remove them. I agree they are pretty useless, thanks!

@mamhoff
Copy link
Contributor

mamhoff commented Nov 28, 2017

I keep my approval.

@jhawthorn jhawthorn merged commit d07e5bd into solidusio:master Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants