Sha256: 547490a6137dea6a0412c245068ffcf805533b3c314e31b2d15c9b99faf0d622

Contents?: true

Size: 401 Bytes

Versions: 1

Compression:

Stored size: 401 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 }

end

Version data entries

1 entries across 1 versions & 1 rubygems

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