mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
ac886fb4cb
8 changed files with 64 additions and 52 deletions
|
@ -3,9 +3,11 @@ class Pricelist < ActiveRecord::Base
|
|||
|
||||
monetize :price_cents
|
||||
|
||||
validates :price_cents, :price_currency, :valid_from, :category, presence: true
|
||||
validates :price_cents, :price_currency, :price,
|
||||
:valid_from, :category, :operation_category, :duration, presence: true
|
||||
|
||||
CATEGORIES = %w(ee com.ee fie.ee pri.ee med.ee)
|
||||
CATEGORIES = %w(ee pri.ee fie.ee med.ee com.ee)
|
||||
OPERATION_CATEGORIES = %w(new renew)
|
||||
DURATIONS = %w(1year 2years 3years)
|
||||
|
||||
after_initialize :init_values
|
||||
|
@ -13,4 +15,8 @@ class Pricelist < ActiveRecord::Base
|
|||
return unless new_record?
|
||||
self.valid_from = Time.zone.now.beginning_of_year
|
||||
end
|
||||
|
||||
def name
|
||||
"#{operation_category} #{category}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue