How can i know weather a record is saved or not?

after creating a new record of a model , using new() is there any way
to know weather an record is saved to dataabase of is it still in
“new” state ?

creating a new record of a model , using new() does not save it to
database until called save

Sijo Kg wrote:

creating a new record of a model , using new() does not save it to
database until called save

recrod.save? will return Boolean.

i just want to know weather it is saved ?
i don want to save it or try to save it !

well, if you dont try to save it, the answer to your question is quite
easy: no.

record.save? will return Boolean.

i just want to know weather it is saved ? i don want to save it or try
to save it !

On Fri, Mar 6, 2009 at 10:52 AM, — Z@m —
[email protected] wrote:

record.save? will return Boolean.

i just want to know weather it is saved ? i don want to save it or try
to save it !

You can do record.new_record? to check if it is a new record

You can do record.new_record? to check if it is a new record

Thank you
thats what i want !

In order to get the right answer, you usually have to ask the right
question :wink:

On Mar 6, 10:07 pm, “— Z@m —” [email protected]