1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added tournament backups to the database and added pages to restore and create backups

This commit is contained in:
2025-01-04 16:27:52 -05:00
parent 698576dac9
commit 49fbf6735d
17 changed files with 497 additions and 41 deletions

View File

@@ -8,6 +8,7 @@ class Tournament < ApplicationRecord
has_many :matches, dependent: :destroy
has_many :delegates, class_name: "TournamentDelegate"
has_many :mat_assignment_rules, dependent: :destroy
has_many :tournament_backups, dependent: :destroy
validates :date, :name, :tournament_type, :address, :director, :director_email , presence: true
@@ -227,5 +228,9 @@ class Tournament < ApplicationRecord
end
end
end
def create_backup()
TournamentBackupService.new(self, "Manual backup").create_backup
end
end

View File

@@ -0,0 +1,5 @@
class TournamentBackup < ApplicationRecord
belongs_to :tournament
validates :backup_data, presence: true
end