Sha256: c564f47a46902b93f81f1d141e04573c81edf9b4a0c2956b6cc198ab7334adfa
Contents?: true
Size: 503 Bytes
Versions: 5
Compression:
Stored size: 503 Bytes
Contents
module Shoppe class StockLevelAdjustment < ActiveRecord::Base # Relationships belongs_to :product belongs_to :parent, :polymorphic => true # Validations validates :product_id, :presence => true validates :description, :presence => true validates :adjustment, :numericality => true validate { errors.add(:adjustment, "must be greater or less than zero") if adjustment == 0 } # Scopes scope :ordered, -> { order('created_at desc') } end end
Version data entries
5 entries across 5 versions & 1 rubygems