From 4b57d7b163e2b2b82403d709b0d4b97e87c72af3 Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Tue, 25 Oct 2011 09:37:38 -0700 Subject: [PATCH] revert #21 --- app/models/domain.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index ffd6e14..38aeea6 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -35,17 +35,6 @@ class Domain < ActiveRecord::Base validates_associated :records validates :user_id, :presence => true - validate :domain_ownership - def domain_ownership # domain ownership - segments = name.split('.') - if segments.size > 2 - parent = segments[1..-1].join('.') - unless Domain.exists?(:name => parent, :user_id => user_id) - errors.add :name, "issue, must create the domain named `#{parent}` first" - end - end - end - validate :max_domains_per_user, :on => :create def max_domains_per_user # domains per user limit for DOS protection max = Settings.max_domains_per_user.to_i