Sha256: bdc8976ae2bda38806102e89a549d8ce8849c278ee8e7c7ce63e886162c15578

Contents?: true

Size: 499 Bytes

Versions: 106

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

module Spree
  module Gallery
    class VariantGallery
      def initialize(variant)
        @variant = variant
      end

      # A list of all images associated with this gallery
      #
      # @return [Enumerable<Spree::Image>] all images in the gallery
      def images
        @images ||=
          @variant.images.presence ||
          (!@variant.is_master? && @variant.product.master.images).presence ||
          Spree::Image.none
      end
    end
  end
end

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
solidus_core-4.4.2 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.4.1 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.4.0 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.3.4 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.2.4 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.1.5 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.3.3 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.3.2 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.1.4 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.3.1 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.3.0 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.2.3 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.1.3 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.0.4 app/models/spree/gallery/variant_gallery.rb
solidus_core-3.4.6 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.0.3 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.1.2 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.2.2 app/models/spree/gallery/variant_gallery.rb
solidus_core-3.4.5 app/models/spree/gallery/variant_gallery.rb
solidus_core-4.2.1 app/models/spree/gallery/variant_gallery.rb