db hook to manage files

This commit is contained in:
2016-10-06 20:10:36 -05:00
parent c5e79fc427
commit 697c896277
10 changed files with 29 additions and 7 deletions

View File

@ -6,4 +6,12 @@ class Account < ApplicationRecord
validates :password, presence: true
validates :home_folder, presence: true
validates :contact_email, presence: true, email_format: true
after_commit :update_vsftpd_files
def update_vsftpd_files
vsftp = FtpConfig.new
vsftp.build_password_list Account.all
vsftp.build_user_configs self
end
end