property
name ="activoSN"
column="Activo"
type ="boolean"
casts ="casts.BooleanSNCast";
property
name ="active"
column="Active"
type ="boolean"
casts ="BooleanCast@quick";
Creating a preSave hook inside component, won't use the custom cast of the property:
function preSave(){
this.assignAttribute( "activoSN", this.getActive()); //-> This will set activoSN to 1 or 0, but the cast its made to be 'S' or 'N' according of the boolean
}
Setting like this, will make it right:
usuario.fill( {
"activoSN" : true //This will be 'S' on the DB
} );
usuario.save();
Creating a preSave hook inside component, won't use the custom cast of the property:
function preSave(){ this.assignAttribute( "activoSN", this.getActive()); //-> This will set activoSN to 1 or 0, but the cast its made to be 'S' or 'N' according of the boolean }Setting like this, will make it right:
usuario.fill( { "activoSN" : true //This will be 'S' on the DB } ); usuario.save();