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


#1

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 ?


#2

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


#3

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.


#4

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.


#5

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 !


#6

On Fri, Mar 6, 2009 at 10:52 AM, — Z@m —
removed_email_address@domain.invalid 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


#7

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

Thank you
thats what i want !


#8

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

On Mar 6, 10:07 pm, “— Z@m —” removed_email_address@domain.invalid