mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Add nonverified email color to registrar show
This commit is contained in:
parent
e95996fa12
commit
62acd8892a
7 changed files with 33 additions and 24 deletions
|
@ -16,10 +16,6 @@ class Contact < ApplicationRecord
|
|||
has_many :legal_documents, as: :documentable
|
||||
has_many :registrant_domains, class_name: 'Domain', foreign_key: 'registrant_id'
|
||||
has_many :actions, dependent: :destroy
|
||||
belongs_to :email_address_verification, class_name: 'EmailAddressVerification',
|
||||
primary_key: 'email',
|
||||
foreign_key: 'email',
|
||||
optional: true
|
||||
|
||||
attr_accessor :legal_document_id
|
||||
alias_attribute :kind, :ident_type
|
||||
|
@ -28,8 +24,9 @@ class Contact < ApplicationRecord
|
|||
accepts_nested_attributes_for :legal_documents
|
||||
|
||||
scope :email_not_verified, lambda {
|
||||
joins(:email_address_verification)
|
||||
.where('verified_at IS NULL OR verified_at <= ?', EmailAddressVerification.verification_period)
|
||||
joins('LEFT JOIN :email_address_verifications emv ON contacts.email = emv.email')
|
||||
.where('verified_at IS NULL OR verified_at <= ?',
|
||||
EmailAddressVerification.verification_period)
|
||||
}
|
||||
|
||||
validates :name, :email, presence: true
|
||||
|
|
|
@ -13,14 +13,16 @@ class Registrar < ApplicationRecord
|
|||
has_many :nameservers, through: :domains
|
||||
has_many :whois_records
|
||||
has_many :white_ips, dependent: :destroy
|
||||
belongs_to :email_address_verification, class_name: 'EmailAddressVerification',
|
||||
primary_key: 'email',
|
||||
foreign_key: 'email',
|
||||
optional: true
|
||||
belongs_to :billing_email_address_verification, class_name: 'EmailAddressVerification',
|
||||
primary_key: 'email',
|
||||
foreign_key: 'billing_email',
|
||||
optional: true
|
||||
# belongs_to :email_address_verification, class_name: 'EmailAddressVerification',
|
||||
# primary_key: 'email',
|
||||
# foreign_key: 'email',
|
||||
# optional: true,
|
||||
# inverse_of: :registrar
|
||||
# belongs_to :billing_email_address_verification, class_name: 'EmailAddressVerification',
|
||||
# primary_key: 'email',
|
||||
# foreign_key: 'billing_email',
|
||||
# optional: true,
|
||||
# inverse_of: :billing_registrar
|
||||
|
||||
delegate :balance, to: :cash_account, allow_nil: true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue