Sha256: 20f5e16627de4fa25c7ad526ad886a7ccee18d708e6794d92a6cbaa4ff7a1ceb

Contents?: true

Size: 907 Bytes

Versions: 4

Compression:

Stored size: 907 Bytes

Contents

module Spree
  module V2
    module Storefront
      class StoreSerializer < BaseSerializer
        set_type :store

        attributes :name, :url, :meta_description, :meta_keywords, :seo_title, :default_currency, :default, :supported_currencies, :facebook,
                   :twitter, :instagram, :default_locale, :customer_support_email, :default_country_id, :description,
                   :address, :contact_phone, :supported_locales, :settings

        has_many :menus
        has_many :cms_pages

        has_one :default_country, serializer: :country, record_type: :country, id_method_name: :default_country_id

        attribute :favicon_path do |store|
          if store.favicon_image.attached?
            url_helpers = Rails.application.routes.url_helpers
            url_helpers.rails_representation_path(store.favicon, only_path: true)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_api-4.4.1 app/serializers/spree/v2/storefront/store_serializer.rb
spree_api-4.4.0 app/serializers/spree/v2/storefront/store_serializer.rb
spree_api-4.4.0.rc2 app/serializers/spree/v2/storefront/store_serializer.rb
spree_api-4.4.0.rc1 app/serializers/spree/v2/storefront/store_serializer.rb