Sha256: f9090256ee79e24bfafce7f149a4572407a95b436933994e7baad2c5c74f0682

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

module Shopper
  class Coupon < ApplicationRecord
    belongs_to :order, optional: true

    validates :code, presence: true
    validates :discount,
              presence: true,
              numericality: {
                greater_than_or_equal_to: 0,
                less_than_or_equal_to: 100
              }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoppper-0.1.0 app/models/shopper/coupon.rb