app/models/macro_step.rb
# Here we perform some magic to inherit the validations from our parent
# #Record (record_type)
Here we perform some magic to inherit the validations from our parent
Record (record_type)
Here we perform some magic to inherit the validations from our parent Record ( record_type )
def validate_macro_step
    return if self.record_type.blank? || !self.errors[:record_type].blank?
    record = build
    record.errors.each do |k,v|
      next if k == :domain_id || k == :ttl
      next if k == :content || k == :prio unless content_required?
      next if k == :name && v == I18n.t('activerecord.errors.messages.blank')
      self.errors.add( k, v )
    end unless record.valid?
  end
def validate_macro_step return if self . record_type . blank? || ! self . errors [ :record_type ] . blank? record = build record . errors . each do | k , v | next if k == :domain_id || k == :ttl next if k == :content || k == :prio unless content_required? next if k == :name && v == I18n . t ( 'activerecord.errors.messages.blank' ) self . errors . add ( k , v ) end unless record . valid? end
Here we perform some magic to inherit the validations from our parent
Record (record_type)
Here we perform some magic to inherit the validations from our parent Record ( record_type )
# Since we don't have a domain, blank name validations will # prevent pretty useful (and dangerous) macro steps from being # created. This check offsets that, but might be flawed.