Class: Spree::CommissionRateValue

Inherits:
Object
  • Object
show all
Extended by:
DisplayMoney
Defined in:
app/models/spree/commission_rate_value.rb

Overview

What a commission rate charges in one currency, and the bounds it charges within: a flat fee's amount, and a percentage's min_amount floor and max_amount cap.

An amount cannot travel the way a percentage can — "2" means nothing without saying 2 of what — so a rate states one per currency rather than having a figure converted on its behalf at sale time. A converted number would drift daily against a fee the seller agreed to, and a cap that moves is not a cap.

Instance Method Summary collapse

Methods included from DisplayMoney

money_methods

Instance Method Details

#bounded? ⇒ Boolean

Whether this row states a floor or a cap, as opposed to only a flat fee.

Returns:

  • (Boolean)


34
35
36
# File 'app/models/spree/commission_rate_value.rb', line 34

def bounded?
  min_amount.present? || max_amount.present?
end