app/models/record_template.rb
# Update our convenience accessors when the object has changed
Update our convenience accessors when the object has changed
Update our convenience accessors when the object has changed
def update_convenience_accessors
    return unless self.record_type == 'SOA'
    @primary_ns, @contact, @serial, @refresh, @retry, @expire, @minimum =
      self[:content].split(/\s+/) unless self[:content].blank?
    %w{ serial refresh retry expire minimum }.each do |i|
      value = instance_variable_get("@#{i}")
      value = value.to_i unless value.nil?
      send("#{i}=", value )
    end
  end
def update_convenience_accessors return unless self . record_type == 'SOA' @primary_ns , @contact , @serial , @refresh , @retry , @expire , @minimum = self [ :content ] . split ( / \s + / ) unless self [ :content ] . blank? %w{ serial refresh retry expire minimum } . each do | i | value = instance_variable_get ( "@#{i}" ) value = value . to_i unless value . nil? send ( "#{i}=" , value ) end end
Update our convenience accessors when the object has changed
Update our convenience accessors when the object has changed
# Setup our convenience values