Browse Source

AAAA scope fix (left out by mistake previously)

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
36e1df843d
  1. 2
      app/controllers/aaaas_controller.rb
  2. 2
      app/models/record.rb

2
app/controllers/aaaas_controller.rb

@ -16,7 +16,7 @@ class AaaasController < ApplicationController
# override to use :mx_records instead of :records assoc # override to use :mx_records instead of :records assoc
def beginning_of_chain def beginning_of_chain
if nested? && nested.association && nested.association.collection? && nested.association.name == :records if nested? && nested.association && nested.association.collection? && nested.association.name == :records
nested.parent_scope.a_records nested.parent_scope.aaaa_records
else else
super super
end end

2
app/models/record.rb

@ -3,7 +3,7 @@ class Record < ActiveRecord::Base
belongs_to :user, :inverse_of => :records belongs_to :user, :inverse_of => :records
cattr_reader :types cattr_reader :types
@@types = %w(SOA NS A MX TXT CNAME) @@types = %w(SOA NS A MX TXT CNAME AAAA)
validates :domain, :name, :presence => true validates :domain, :name, :presence => true
validates :type, :inclusion => {:in => @@types, :message => "Unknown record type"} validates :type, :inclusion => {:in => @@types, :message => "Unknown record type"}

Loading…
Cancel
Save