1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

add option to not provision databases for servers

هذا الالتزام موجود في:
Adam Cooke
2017-05-08 16:41:37 +01:00
الأصل 87560c9edf
التزام 5cd0e4dc04

عرض الملف

@@ -46,6 +46,8 @@ class Server < ApplicationRecord
include HasUUID include HasUUID
include HasSoftDestroy include HasSoftDestroy
attr_accessor :provision_database
belongs_to :organization belongs_to :organization
belongs_to :ip_pool, :optional => true belongs_to :ip_pool, :optional => true
has_many :domains, :dependent => :destroy, :as => :owner has_many :domains, :dependent => :destroy, :as => :owner
@@ -82,11 +84,15 @@ class Server < ApplicationRecord
end end
after_create do after_create do
message_db.provisioner.provision unless self.provision_database == false
message_db.provisioner.provision
end
end end
after_commit(:on => :destroy) do after_commit(:on => :destroy) do
message_db.provisioner.drop unless self.provision_database == false
message_db.provisioner.drop
end
end end
def status def status