Refactor zones

#475
This commit is contained in:
Artur Beljajev 2017-04-24 18:20:06 +03:00
parent eeb4849c1e
commit 91fab05bfb
9 changed files with 136 additions and 20 deletions

View file

@ -724,5 +724,9 @@ class Domain < ActiveRecord::Base
def self.delete_candidates
where("#{attribute_alias(:delete_time)} < ?", Time.zone.now)
end
def self.uses_zone?(zone)
exists?(["name ILIKE ?", "%.#{zone.origin}"])
end
end
# rubocop: enable Metrics/ClassLength