app/models/record_template.rb
# Here we perform some magic to inherit the validations from the "destination"
# model without any duplication of rules. This allows us to simply extend the
# appropriate record and gain those validations in the templates
Here we perform some magic to inherit the validations from the "destination"
model without any duplication of rules. This allows us to simply extend the
appropriate record and gain those validations in the templates
Here we perform some magic to inherit the validations from the " destination " model without any duplication of rules . This allows us to simply extend the appropriate record and gain those validations in the templates
def validate_record_template 
    unless self.record_type.blank?
      record = build
      record.errors.each do |k,v|
        next if k == :domain_id || k == :name || k == :contact
        self.errors.add( k, v )
      end unless record.valid?
    end
  end
def validate_record_template unless self . record_type . blank? record = build record . errors . each do | k , v | next if k == :domain_id || k == :name || k == :contact self . errors . add ( k , v ) end unless record . valid? end end
Here we perform some magic to inherit the validations from the "destination"
model without any duplication of rules.
Here we perform some magic to inherit the validations from the " destination " model without any duplication of rules .
#:nodoc: # skip associations we don't have, validations we don't care about