mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
We're now handling these values on the frontend, so can keep this simple. fixes up: Add numericality validation for * Add translation for Active Record error message
19 lines
341 B
Ruby
19 lines
341 B
Ruby
# frozen_string_literal: false
|
|
|
|
module Calculator
|
|
class FlatRate < Spree::Calculator
|
|
preference :amount, :decimal, default: 0
|
|
|
|
validates :preferred_amount,
|
|
numericality: true
|
|
|
|
def self.description
|
|
I18n.t(:flat_rate_per_order)
|
|
end
|
|
|
|
def compute(_object = nil)
|
|
preferred_amount
|
|
end
|
|
end
|
|
end
|