Sha256: fddbac32128be0907742beb392403266c688ec892e74bae451d8bd7c6817b51c
Contents?: true
Size: 1.36 KB
Versions: 16
Compression:
Stored size: 1.36 KB
Contents
module Spree module Api module V2 module Storefront class TaxonsController < ::Spree::Api::V2::ResourceController private def collection_serializer Spree::Api::Dependencies.storefront_taxon_serializer.constantize end def resource_serializer Spree::Api::Dependencies.storefront_taxon_serializer.constantize end def collection_finder Spree::Api::Dependencies.storefront_taxon_finder.constantize end def paginated_collection @paginated_collection ||= collection_paginator.new(collection, params).call end def resource @resource ||= find_with_fallback_default_locale { scope.find_by(permalink: params[:id]) } || scope.find(params[:id]) end def model_class Spree::Taxon end def scope_includes node_includes = %i[icon parent taxonomy translations] { parent: node_includes, children: node_includes, taxonomy: [root: node_includes], icon: [attachment_attachment: :blob], translations: [] } end def serializer_params super.merge(include_products: action_name == 'show') end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems