mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
16 lines
250 B
Ruby
16 lines
250 B
Ruby
# frozen_string_literal: false
|
|
|
|
class Voucher < ApplicationRecord
|
|
belongs_to :enterprise
|
|
|
|
validates :code, presence: true, uniqueness: { scope: :enterprise_id }
|
|
|
|
def value
|
|
10
|
|
end
|
|
|
|
def display_value
|
|
Spree::Money.new(value)
|
|
end
|
|
end
|