Sha256: 52223fd4082e85ad6ef418cbcade9fa1b256a01934e784b65ab51bfa1ac3403c
Contents?: true
Size: 1.28 KB
Versions: 20
Compression:
Stored size: 1.28 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 ||= 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] { parent: node_includes, children: node_includes, taxonomy: [root: node_includes], icon: [attachment_attachment: :blob] } end def serializer_params super.merge(include_products: action_name == 'show') end end end end end end
Version data entries
20 entries across 20 versions & 3 rubygems