mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
parent
84bc0f8914
commit
53a34ee2d6
9 changed files with 94 additions and 12 deletions
18
app/models/concerns/contact/identical.rb
Normal file
18
app/models/concerns/contact/identical.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
module Concerns::Contact::Identical
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
ATTRIBUTE_FILTER = %w[
|
||||
name
|
||||
ident
|
||||
ident_type
|
||||
ident_country_code
|
||||
phone
|
||||
email
|
||||
]
|
||||
private_constant :ATTRIBUTE_FILTER
|
||||
|
||||
def identical(registrar)
|
||||
self.class.where(attributes.slice(*ATTRIBUTE_FILTER)).where(registrar: registrar)
|
||||
.where.not(id: id).take
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue