Browse Source

revert #21

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
4b57d7b163
  1. 11
      app/models/domain.rb

11
app/models/domain.rb

@ -35,17 +35,6 @@ class Domain < ActiveRecord::Base
validates_associated :records validates_associated :records
validates :user_id, :presence => true 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 validate :max_domains_per_user, :on => :create
def max_domains_per_user # domains per user limit for DOS protection def max_domains_per_user # domains per user limit for DOS protection
max = Settings.max_domains_per_user.to_i max = Settings.max_domains_per_user.to_i

Loading…
Cancel
Save