Class: Spree::Category

Inherits:
Taxon
  • Object
show all
Defined in:
app/models/spree/category.rb

Overview

Public API name for Taxon, used by the admin dashboard. Unlike a legacy Spree::Taxon, a Category does not require a Spree::Taxonomy — it is owned directly via store_id, so a parentless category is a genuine top-level node. (Legacy taxonomy-backed taxons are unaffected.) Will become the base class in 6.0 when Spree::Taxonomy is dropped and spree_taxons is renamed to spree_categories.

Constant Summary

Constants inherited from Taxon

Taxon::MEMOIZED_METHODS, Taxon::RICH_TEXT_TRANSLATABLE_FIELDS, Taxon::RULES_MATCH_POLICIES, Taxon::SORT_ORDERS, Taxon::TRANSLATABLE_FIELDS

Instance Method Summary collapse

Methods inherited from Taxon

#active_products_with_descendants, #cached_self_and_descendants_ids, #child_index=, #generate_pretty_name, #generate_slug, #manual?, #manual_sort_order?, #products_matching_rules, recalculate_products_count, #regenerate_pretty_name_and_permalink, #regenerate_pretty_name_and_permalink_as_child, #regenerate_taxon_products, search_by_name, #seo_title, #set_permalink, #set_pretty_name, #slug, #slug=, #store

Methods included from Metadata

#metadata, #metadata=, #public_metadata=

Methods included from TranslatableResource

#get_field_with_locale, #translatable_store, #upsert_translations

Instance Method Details

#requires_taxonomy?Boolean

A category is owned directly via store_id and never needs a taxonomy.

Returns:



12
13
14
# File 'app/models/spree/category.rb', line 12

def requires_taxonomy?
  false
end