mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
rubocop autocorret to get tests green
This commit is contained in:
parent
c0caf53878
commit
2d6ed7fa45
24 changed files with 105 additions and 112 deletions
|
@ -5,8 +5,8 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
include EppErrors
|
||||
|
||||
#has_one :local_address, dependent: :destroy
|
||||
#has_one :international_address, dependent: :destroy
|
||||
# has_one :local_address, dependent: :destroy
|
||||
# has_one :international_address, dependent: :destroy
|
||||
has_one :address, dependent: :destroy
|
||||
has_one :disclosure, class_name: 'ContactDisclosure'
|
||||
|
||||
|
@ -20,22 +20,22 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
accepts_nested_attributes_for :address, :disclosure
|
||||
|
||||
validates :code, :phone, :email, :ident, :address, :registrar,presence: true
|
||||
validates :code, :phone, :email, :ident, :address, :registrar, presence: true
|
||||
|
||||
validate :ident_must_be_valid
|
||||
#validate :presence_of_one_address
|
||||
# validate :presence_of_one_address
|
||||
|
||||
validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/ # /\+\d{3}\.\d+/
|
||||
validates :email, format: /@/
|
||||
|
||||
validates :code, uniqueness: { message: :epp_id_taken }
|
||||
|
||||
delegate :country, to: :address#, prefix: true
|
||||
delegate :city, to: :address#, prefix: true
|
||||
delegate :street, to: :address#, prefix: true
|
||||
delegate :zip, to: :address#, prefix: true
|
||||
delegate :country, to: :address # , prefix: true
|
||||
delegate :city, to: :address # , prefix: true
|
||||
delegate :street, to: :address # , prefix: true
|
||||
delegate :zip, to: :address # , prefix: true
|
||||
|
||||
#scopes
|
||||
# scopes
|
||||
scope :current_registrars, ->(id) { where(registrar_id: id) }
|
||||
# archiving
|
||||
has_paper_trail class_name: 'ContactVersion'
|
||||
|
@ -97,7 +97,6 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
# should use only in transaction
|
||||
def destroy_and_clean
|
||||
|
||||
if relations_with_domain?
|
||||
errors.add(:domains, :exist)
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue