mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 14:14:49 +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,
|
sum: @sum,
|
||||||
currency: @account.currency,
|
currency: @account.currency,
|
||||||
description: params[:description],
|
description: params[:description],
|
||||||
activity_type: AccountActivity::ADD_CREDIT)
|
activity_type: AccountActivity::UPDATE_CREDIT)
|
||||||
|
|
||||||
if activity.save
|
if activity.save
|
||||||
true
|
true
|
||||||
|
|
|
@ -8,6 +8,7 @@ class AccountActivity < ApplicationRecord
|
||||||
CREATE = 'create'
|
CREATE = 'create'
|
||||||
RENEW = 'renew'
|
RENEW = 'renew'
|
||||||
ADD_CREDIT = 'add_credit'
|
ADD_CREDIT = 'add_credit'
|
||||||
|
UPDATE_CREDIT = 'update_credit'
|
||||||
|
|
||||||
after_create :update_balance
|
after_create :update_balance
|
||||||
def update_balance
|
def update_balance
|
||||||
|
@ -20,7 +21,7 @@ class AccountActivity < ApplicationRecord
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def types_for_select
|
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
|
end
|
||||||
|
|
||||||
def to_csv
|
def to_csv
|
||||||
|
|
|
@ -603,6 +603,7 @@ en:
|
||||||
receipt_date_from: 'Receipt date from'
|
receipt_date_from: 'Receipt date from'
|
||||||
receipt_date_until: 'Receipt date until'
|
receipt_date_until: 'Receipt date until'
|
||||||
add_credit: 'Add credit'
|
add_credit: 'Add credit'
|
||||||
|
update_credit: 'Update credit'
|
||||||
invalid_yaml: 'Invalid YAML'
|
invalid_yaml: 'Invalid YAML'
|
||||||
reserved_pw: 'Reserved pw'
|
reserved_pw: 'Reserved pw'
|
||||||
no_transfers_found: 'No transfers found'
|
no_transfers_found: 'No transfers found'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue