Sha256: cca31f94684b48eb02d7ffc573f532fb2abbfe86964f078f1b21ce183cb32bff

Contents?: true

Size: 364 Bytes

Versions: 6

Compression:

Stored size: 364 Bytes

Contents

module Spree
  module ProductDecorator
    def self.included(base)
      base.class_eval do
        delegate :attachments, to: :find_or_build_master
        has_many :variant_attachments, -> { order(:position) }, source: :attachments,
                 through: :variants_including_master
      end
    end
  end
end

Spree::Product.include Spree::ProductDecorator

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solidus_product_attachments-0.0.7 app/models/spree/product_decorator.rb
solidus_product_attachments-0.0.6 app/models/spree/product_decorator.rb
solidus_product_attachments-0.0.5 app/models/spree/product_decorator.rb
solidus_product_attachments-0.0.4 app/models/spree/product_decorator.rb
solidus_product_attachments-0.0.2 app/models/spree/product_decorator.rb
solidus_product_attachments-0.0.1 app/models/spree/product_decorator.rb