mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
Add statuses to domain
This commit is contained in:
parent
b0e9828a01
commit
32fc26b5a4
7 changed files with 60 additions and 10 deletions
|
@ -25,6 +25,12 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
has_and_belongs_to_many :nameservers
|
||||
|
||||
has_many :domain_statuses
|
||||
|
||||
has_many :statuses, -> {
|
||||
where(setting_group: SettingGroup.domain_statuses)
|
||||
}, through: :domain_statuses, source: :setting
|
||||
|
||||
delegate :code, to: :owner_contact, prefix: true
|
||||
delegate :name, to: :registrar, prefix: true
|
||||
|
||||
|
|
4
app/models/domain_status.rb
Normal file
4
app/models/domain_status.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class DomainStatus < ActiveRecord::Base
|
||||
belongs_to :domain
|
||||
belongs_to :setting
|
||||
end
|
|
@ -11,5 +11,9 @@ class SettingGroup < ActiveRecord::Base
|
|||
def domain_validation
|
||||
find_by(code: 'domain_validation')
|
||||
end
|
||||
|
||||
def domain_statuses
|
||||
find_by(code: 'domain_statuses')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue