Updating a row in the database


#1

What’s the difference between updating an entry in the database using
the #save method and the #update method?

Thanks,
Thomaz


#2

On 6/8/07, thomazleite removed_email_address@domain.invalid wrote:

What’s the difference between updating an entry in the database using
the #save method and the #update method?

A save made a check for see if the Object exist or not. If exist, the
Object is save else, it’s update.

With the #update, you must use a id who exist and define the attribute
to update. And it’s a public classe Method not instance method, so you
use it only with Name class, not with your Object.


Cyril M.


#3

On 7 jun, 18:37, “Cyril M.” removed_email_address@domain.invalid wrote:

On 6/8/07, thomazleite removed_email_address@domain.invalid wrote:

A save made a check for see if the Object exist or not. If exist, the
Object is save else, it’s update.

With the #update, you must use a id who exist and define the attribute
to update. And it’s a public classe Method not instance method, so you
use it only with Name class, not with your Object.

I’m coding a change password method in my application. When I use
#update, a invalid password gets saved. The same doesn’t happens with
#save.


#4

On 6/8/07, Thomaz L. removed_email_address@domain.invalid wrote:

I’m coding a change password method in my application. When I use
#update, a invalid password gets saved. The same doesn’t happens with
#save.

How use you update method ?


Cyril M.