mirror of
https://github.com/internetee/registry.git
synced 2025-08-16 06:23:57 +02:00
Fixed inverse_of issues
This commit is contained in:
parent
d50c3f0b45
commit
392e284463
2 changed files with 4 additions and 2 deletions
|
@ -5,7 +5,7 @@ class Action < ApplicationRecord
|
||||||
belongs_to :contact, optional: true
|
belongs_to :contact, optional: true
|
||||||
has_many :subactions, class_name: 'Action',
|
has_many :subactions, class_name: 'Action',
|
||||||
foreign_key: 'bulk_action_id',
|
foreign_key: 'bulk_action_id',
|
||||||
inverse_of: :action,
|
inverse_of: :bulk_action,
|
||||||
dependent: :destroy
|
dependent: :destroy
|
||||||
belongs_to :bulk_action, class_name: 'Action', optional: true
|
belongs_to :bulk_action, class_name: 'Action', optional: true
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,7 @@ class RegistrantUser < User
|
||||||
def last_name
|
def last_name
|
||||||
username.split.second
|
username.split.second
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
def update_related_contacts
|
def update_related_contacts
|
||||||
grouped_contacts = Contact.where(ident: ident, ident_country_code: country.alpha2)
|
grouped_contacts = Contact.where(ident: ident, ident_country_code: country.alpha2)
|
||||||
|
@ -126,7 +127,8 @@ class RegistrantUser < User
|
||||||
registrar.notify(bulk_action || action)
|
registrar.notify(bulk_action || action)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/MethodLength
|
# rubocop:enable Metrics/MethodLength
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def find_or_create_by_api_data(user_data = {})
|
def find_or_create_by_api_data(user_data = {})
|
||||||
return false unless user_data[:ident]
|
return false unless user_data[:ident]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue