Skip to content

Commit

Permalink
Deprecate all_taxons
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Clarke Brunsdon committed Nov 28, 2017
1 parent c56787b commit fff13ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/lib/spree/core/product_filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def self.taxons_below(taxon)
#
# idea: expand the format to allow nesting of labels?
def self.all_taxons
Spree::Deprecation.warn "all_taxons is deprecated in solidus_core. Please add it to your own application to continue using it."
taxons = Spree::Taxonomy.all.map { |t| [t.root] + t.root.descendants }.flatten
{
name: 'All taxons',
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/views/spree/shared/_filters.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% filters = @taxon ? @taxon.applicable_filters : [Spree::Core::ProductFilters.all_taxons] %>
<% filters = @taxon.applicable_filters %>
<% unless filters.empty? %>
<%= form_tag '', method: :get, id: 'sidebar_products_search' do %>
<%= hidden_field_tag 'per_page', params[:per_page] %>
Expand Down

0 comments on commit fff13ea

Please sign in to comment.