aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/price_estimate.rb
blob: 669d0991f718d6e480edf72f88318052237ab2f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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