add paper trail
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
# fk_rails_... (user_id => users.id)
|
||||
#
|
||||
class Balance < ApplicationRecord
|
||||
include Trackable
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :currency
|
||||
|
||||
|
||||
8
app/models/concerns/trackable.rb
Normal file
8
app/models/concerns/trackable.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
module Trackable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
has_paper_trail
|
||||
end
|
||||
end
|
||||
@@ -20,6 +20,8 @@
|
||||
# fk_rails_... (user_id => users.id)
|
||||
#
|
||||
class FiatBalance < ApplicationRecord
|
||||
include Trackable
|
||||
|
||||
belongs_to :user
|
||||
|
||||
monetize :amount_cents
|
||||
|
||||
Reference in New Issue
Block a user