Sha256: 1275af01cbe999f17ccc771bc71ffb668309ac0314f53e1ee6ee946c0c7b134f

Contents?: true

Size: 331 Bytes

Versions: 4

Compression:

Stored size: 331 Bytes

Contents

class Spree::VolumePriceModel < ActiveRecord::Base
  has_many :variants
  has_many :volume_prices, -> { order(position: :asc) }, dependent: :destroy
  accepts_nested_attributes_for :volume_prices, allow_destroy: true,
    reject_if: proc { |volume_price|
      volume_price[:amount].blank? && volume_price[:range].blank?
    }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_volume_pricing-0.2.1 app/models/spree/volume_price_model.rb
solidus_volume_pricing-0.1.1 app/models/spree/volume_price_model.rb
solidus_volume_pricing-0.2.0 app/models/spree/volume_price_model.rb
solidus_volume_pricing-0.1.0 app/models/spree/volume_price_model.rb