method

validate_on_create

v1.1.6 - Show latest stable - Class: Person
validate_on_create()
protected

No documentation available.

# File activerecord/examples/validation.rb, line 46
    def validate_on_create
      if attribute_present?("name") && Person.name_exists?(name)
          errors.add("name", "is already taken by another person")
      end
    end