Forum: Ruby on Rails save and save! fail but no errors are created

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eero S. (Guest)
on 2005-12-15 09:53
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 :/

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
Jeremy K. (Guest)
on 2005-12-15 09:58
(Received via mailing list)
-----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 :/

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-----
Eero S. (Guest)
on 2005-12-15 10:26
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 :/
>
> 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
This topic is locked and can not be replied to.