Validation not executing on save - need help debugging

All,

The validation on my object is not being triggered any more on the save
action.

I’m trying to debug it. In attempting to debug it, I’m trying to
understand exactly what validates_presence_of does. Basically, I’m
trying to see if for some reason, validates_presence_of doesn’t think my
fields are blank now. I see from the API docs. that
validates_presence_of:

"Validates that the specified attributes are not blank (as defined by
Object#blank?). Happens by default on save. "

What is Object#blank?

There isn’t any blank method at either class or instance level on
Object.

Thanks,
Wes

Wes G. wrote:

All,

The validation on my object is not being triggered any more on the save
action.

I’m trying to debug it. In attempting to debug it, I’m trying to
understand exactly what validates_presence_of does. Basically, I’m
trying to see if for some reason, validates_presence_of doesn’t think my
fields are blank now. I see from the API docs. that
validates_presence_of:

"Validates that the specified attributes are not blank (as defined by
Object#blank?). Happens by default on save. "

What is Object#blank?

There isn’t any blank method at either class or instance level on
Object.

Thanks,
Wes

What does validates_presence_of do exactly? Does it set up a callback
that gets executed on save?

How can I verify that it is actually being called?

Thanks,
Wes

RESOLUTION: I had an overeager rescue block that was hiding an error
that occurred before any of the validation was called. Sigh.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs