mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Add deposits controller
This commit is contained in:
parent
5c0e2be387
commit
13c94aeb1c
10 changed files with 88 additions and 4 deletions
|
@ -57,6 +57,7 @@ class Ability
|
|||
can :manage, Depp::Keyrelay
|
||||
can :confirm, :keyrelay
|
||||
can :confirm, :transfer
|
||||
can :manage, :deposit
|
||||
end
|
||||
|
||||
def user
|
||||
|
|
23
app/models/deposit.rb
Normal file
23
app/models/deposit.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
class Deposit
|
||||
include ActiveModel::Validations
|
||||
include ActiveModel::Conversion
|
||||
extend ActiveModel::Naming
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue