Basic donation records
Adds donation model/table and basic manual management in the admin panel, as well as basic listing of users' own donations.
This commit is contained in:
10
app/models/donation.rb
Normal file
10
app/models/donation.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class Donation < ApplicationRecord
|
||||
# Relations
|
||||
belongs_to :user
|
||||
|
||||
# Validations
|
||||
validates_presence_of :amount_sats
|
||||
|
||||
# Hooks
|
||||
# TODO before_create :store_fiat_value
|
||||
end
|
||||
@@ -3,6 +3,7 @@ class User < ApplicationRecord
|
||||
|
||||
# Relations
|
||||
has_many :invitations, dependent: :destroy
|
||||
has_many :donations
|
||||
|
||||
validates_uniqueness_of :cn
|
||||
validates_length_of :cn, :minimum => 3
|
||||
|
||||
Reference in New Issue
Block a user