Save and save! fail but no errors are created


#1

Hi

I will provide code if needed but I am wondering
if there might be a standard cause for this: a
Model I am trying to save seems to fail miserably
at either a #save or #save! call. In the latter
case, a RecordInvalid is raised, but when I inspect
it, the Errors object does not contain any error
messages (full or otherwise). I have tried many
a way but I can not seem to get any error info.

Are there any known scenarios where this would
happen? Troubleshooting is a bit tricky when
there are no errors :confused:

actionmailer 1.1.5
actionpack 1.11.2
actionwebservice 1.0.0
activerecord 1.13.2
activesupport 1.2.5
rails 1.0.0

E


#2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Dec 14, 2005, at 11:53 PM, Eero S. wrote:

happen? Troubleshooting is a bit tricky when
there are no errors :confused:

Perhaps you have a before_save callback returning false and therefore
aborting the save.

jeremy

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDoSGuAQHALep9HFYRAj7eAKCCM7RN7eOiVapi4sgcJr4Iu8PzbgCguS7w
pXEMVAq0+CIcN/myQ2XHnaY=
=HZ8n
-----END PGP SIGNATURE-----


#3

Jeremy K. wrote:

On Dec 14, 2005, at 11:53 PM, Eero S. wrote:

happen? Troubleshooting is a bit tricky when
there are no errors :confused:

Perhaps you have a before_save callback returning false and therefore
aborting the save.

That is precisely what was happening! Shame on me
for not reading the small print. In hindsight it
seems even quite logical.

Perhaps it would be possible for the framework to
generate an error message saying “foo_method failed,
validations cancelled”?

Thanks!

jeremy

E