mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
24 lines
507 B
Ruby
24 lines
507 B
Ruby
class Deposit
|
|
include ActiveModel::Validations
|
|
include ActiveModel::Conversion
|
|
extend ActiveModel::Naming
|
|
include DisableHtml5Validation
|
|
|
|
attr_accessor :amount, :description, :registrar
|
|
|
|
validates :amount, :registrar, presence: true
|
|
|
|
def initialize(attributes = {})
|
|
attributes.each do |name, value|
|
|
send("#{name}=", value)
|
|
end
|
|
end
|
|
|
|
def persisted?
|
|
false
|
|
end
|
|
|
|
def issue_prepayment_invoice
|
|
valid? && registrar.issue_prepayment_invoice(amount, description)
|
|
end
|
|
end
|