Sha256: 3e46bc1374843435d4106399f28edd644811fa8897b8cc7102fa6d3175b7edfe

Contents?: true

Size: 274 Bytes

Versions: 3

Compression:

Stored size: 274 Bytes

Contents

module ShoppingCart
  class Delivery < ApplicationRecord
    has_many :orders, dependent: :nullify

    validates :name, :price, :duration, presence: true
    validates :name, uniqueness: true
    validates :price, numericality: { greater_than_or_equal_to: 0.01 }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loker-shopping-cart-0.1.3 app/models/shopping_cart/delivery.rb
loker-shopping-cart-0.1.2 app/models/shopping_cart/delivery.rb
loker-shopping-cart-0.1.1 app/models/shopping_cart/delivery.rb