mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
parent
3741e2d2a3
commit
58ae53b1e6
17 changed files with 264 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
module Billing
|
||||
class Price < ActiveRecord::Base
|
||||
include Versions
|
||||
include Concerns::Billing::Price::Expirable
|
||||
has_paper_trail class_name: '::PriceVersion'
|
||||
|
||||
self.auto_html5_validation = false
|
||||
|
@ -11,6 +12,7 @@ module Billing
|
|||
validates :operation_category, inclusion: { in: Proc.new { |price| price.class.operation_categories } }
|
||||
validates :duration, inclusion: { in: Proc.new { |price| price.class.durations } }
|
||||
|
||||
alias_attribute :expire_time, :valid_to
|
||||
monetize :price_cents, allow_nil: true, numericality: { greater_than_or_equal_to: 0 }
|
||||
after_initialize :init_values
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue