1

I added a couple columns to a table in MySQL:

  • totalSavings DOUBLE NOT NULL DEFAULT 0
  • totalDebt DOUBLE NOT NULL DEFAULT 0

There are several other columns in the table configured in a similar manner, and CFWheels is appropriately adding a validatesPresenceOf validation to those properties.

But my new ones are not being picked up as required by CFWheels automatic validations. Why is that?

Chris Peters
  • 17,918
  • 6
  • 49
  • 65

1 Answers1

1

As it turns out, CFWheels will skip the validatesPresenceOf automatic validation if there is a DEFAULT value set on the column.

I needed to add the DEFAULT 0 to the column initially so records would be set with that default. But then removing the default fixed the issue with the validation.

Chris Peters
  • 17,918
  • 6
  • 49
  • 65