Sha256: fdddfd79585a0a1ec2220502b54b7eb7069a4f049d541c685b57f59b1da6b4a5

Contents?: true

Size: 453 Bytes

Versions: 1

Compression:

Stored size: 453 Bytes

Contents

# Price 是价格。

class Unidom::Price::Price < ActiveRecord::Base

  self.table_name = 'unidom_prices'

  validates :amount, presence: true, numericality: { less_than: 1000000000, greater_than: 0 }

  belongs_to :priced, polymorphic: true
  belongs_to :pricer, polymorphic: true

  scope :priced_by, ->(pricer) { where pricer: pricer }
  scope :priced_is, ->(priced) { where priced: priced }

  include Unidom::Common::Concerns::ModelExtension

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-price-0.2 app/models/unidom/price/price.rb