mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
parent
ffd29f6a67
commit
b9df5aa92d
11 changed files with 411 additions and 281 deletions
20
app/models/concerns/domain/activatable.rb
Normal file
20
app/models/concerns/domain/activatable.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Concerns::Domain::Activatable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def active?
|
||||
!inactive?
|
||||
end
|
||||
|
||||
def inactive?
|
||||
statuses.include?(DomainStatus::INACTIVE)
|
||||
end
|
||||
|
||||
def activate
|
||||
statuses.delete(DomainStatus::INACTIVE)
|
||||
end
|
||||
|
||||
def deactivate
|
||||
return if inactive?
|
||||
statuses << DomainStatus::INACTIVE
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue