method

define_validations

rails latest stable - Class: ActiveRecord::Associations::Builder::SingularAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.2.9) is shown here.

define_validations(model, reflection)
public

No documentation available.

# File activerecord/lib/active_record/associations/builder/singular_association.rb, line 31
    def self.define_validations(model, reflection)
      super
      if reflection.options[:required]
        model.validates_presence_of reflection.name
      end
    end