mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 06:04:56 +02:00
added activity type
This commit is contained in:
parent
ee442beb2e
commit
b425a14f39
3 changed files with 4 additions and 2 deletions
|
@ -30,7 +30,7 @@ module Admin
|
|||
sum: @sum,
|
||||
currency: @account.currency,
|
||||
description: params[:description],
|
||||
activity_type: AccountActivity::ADD_CREDIT)
|
||||
activity_type: AccountActivity::UPDATE_CREDIT)
|
||||
|
||||
if activity.save
|
||||
true
|
||||
|
|
|
@ -8,6 +8,7 @@ class AccountActivity < ApplicationRecord
|
|||
CREATE = 'create'
|
||||
RENEW = 'renew'
|
||||
ADD_CREDIT = 'add_credit'
|
||||
UPDATE_CREDIT = 'update_credit'
|
||||
|
||||
after_create :update_balance
|
||||
def update_balance
|
||||
|
@ -20,7 +21,7 @@ class AccountActivity < ApplicationRecord
|
|||
|
||||
class << self
|
||||
def types_for_select
|
||||
[CREATE, RENEW, ADD_CREDIT].map { |x| [I18n.t(x), x] }
|
||||
[CREATE, RENEW, ADD_CREDIT, UPDATE_CREDIT].map { |x| [I18n.t(x), x] }
|
||||
end
|
||||
|
||||
def to_csv
|
||||
|
|
|
@ -603,6 +603,7 @@ en:
|
|||
receipt_date_from: 'Receipt date from'
|
||||
receipt_date_until: 'Receipt date until'
|
||||
add_credit: 'Add credit'
|
||||
update_credit: 'Update credit'
|
||||
invalid_yaml: 'Invalid YAML'
|
||||
reserved_pw: 'Reserved pw'
|
||||
no_transfers_found: 'No transfers found'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue