| Class | Domain |
| In: |
app/models/domain.rb
|
| Parent: | ActiveRecord::Base |
finds a domain by its name. The argument name can start with "www.", but it will be removed before searching. So searching for ‘www.example.net’ is exactly the same as searching for just ‘example.net‘
# File app/models/domain.rb, line 33
33: def self.find_by_name(name)
34: self.find(:first, :conditions => [ 'name = ?', self.extract_domain_name(name) ])
35: end
detects the Environment to which this domain belongs, either if it‘s directly owned by one, or through a profile who owns the domain but belongs to a Environment.
# File app/models/domain.rb, line 46
46: def environment
47: case owner
48: when Environment
49: owner
50: when Profile
51: owner.environment
52: end
53: end