Browse Source

tiny refactor

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
8298c06bc9
  1. 10
      app/models/domain.rb

10
app/models/domain.rb

@ -110,7 +110,7 @@ class Domain < ActiveRecord::Base
after_update do
if name_changed?
name_was_pattern = /#{Regexp.escape(name_was)}$/
for record in records.all
records.each do |record|
record.name = record.name.sub(name_was_pattern, name)
record.save!
end
@ -119,12 +119,8 @@ class Domain < ActiveRecord::Base
def each_update_involved_record
yield soa_record
for record in soa_records
yield record
end
for record in records
yield record
end
soa_records.each { |record| yield record }
records.each { |record| yield record }
end
scope :host_domains, where(:name => Settings.host_domains)

Loading…
Cancel
Save