Wes Gamble
2006-Jul-14 18:57 UTC
[Rails] 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 -- Posted via http://www.ruby-forum.com/.
Wes Gamble
2006-Jul-14 19:09 UTC
[Rails] Re: Validation not executing on save - need help debugging
Wes Gamble 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, > WesWhat 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 -- Posted via http://www.ruby-forum.com/.
Apparently Analagous Threads
- Wrap error_messages_for() call when no instance var present
- validate method not getting called?
- Best Practices: Splitting the "view model" from AR model
- Form validation - keepin correct fields displayed on refresh
- Help needed for error in foreign key validation