Return truemail

This reverts commit 862f5639ebbe4d3e6abd5d5be7fb7840e7b83bdf.
This commit is contained in:
Alex Sherman 2020-07-13 15:04:56 +05:00
parent 0a7b754c4c
commit e4a02c2e47
35 changed files with 728 additions and 153 deletions

View file

@ -1,6 +1,7 @@
class Registrar < ApplicationRecord
include Versions # version/registrar_version.rb
include Concerns::Registrar::BookKeeping
include Concerns::EmailVerifable
include Concerns::Registrar::LegalDoc
has_many :domains, dependent: :restrict_with_error
@ -29,14 +30,11 @@ class Registrar < ApplicationRecord
validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than: 100 },
allow_nil: true
validate :forbid_special_code
attribute :vat_rate, ::Type::VATRate.new
after_initialize :set_defaults
validates :email, email_format: { message: :invalid },
allow_blank: true, if: proc { |c| c.will_save_change_to_email? }
validates :billing_email, email_format: { message: :invalid }, allow_blank: true
validate :correct_email_format, if: proc { |c| c.will_save_change_to_email? }
validate :correct_billing_email_format
alias_attribute :contact_email, :email