diff options
Diffstat (limited to 'activerecord/test/models/price_estimate.rb')
-rw-r--r-- | activerecord/test/models/price_estimate.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/models/price_estimate.rb b/activerecord/test/models/price_estimate.rb index ce086e40a3..669d0991f7 100644 --- a/activerecord/test/models/price_estimate.rb +++ b/activerecord/test/models/price_estimate.rb @@ -1,4 +1,14 @@ +# frozen_string_literal: true + class PriceEstimate < ActiveRecord::Base + include ActiveSupport::NumberHelper + belongs_to :estimate_of, polymorphic: true belongs_to :thing, polymorphic: true + + validates_numericality_of :price + + def price + number_to_currency super + end end |