Version 2, last updated by Deivinson Tejeda at September 01, 2007 08:41 UTC

25.4.11 validates_numericality_of

Valida que ciertos atributos tengan un valor numérico antes de insertar ó actualizar.


Ejemplo

  1. <?php
  2. class Productos extends ActiveRecord {
  3. public function __construct(){
  4. $this->validates_numericality_of("precio");
  5. }
  6. }
  7. ?>

Regresar al indice