Forum: Ruby on Rails How can i know weather a record is saved or not?

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.
--- Z@m --- (Guest)
on 2009-03-06 07:20
(Received via mailing list)
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 ?
Sijo k. (Guest)
on 2009-03-06 07:27
 creating a new record of a model , using new() does not save it to
database until called save
Dharmdip R. (Guest)
on 2009-03-06 09:17
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.
--- Z@m --- (Guest)
on 2009-03-06 11:53
(Received via mailing list)
> 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 !
MaD (Guest)
on 2009-03-06 11:59
(Received via mailing list)
> 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.
Franz S. (Guest)
on 2009-03-06 12:03
(Received via mailing list)
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
--- Z@m --- (Guest)
on 2009-03-06 13:08
(Received via mailing list)
> You can do record.new_record? to check if it is a new record

Thank you
thats what i want !
torm3nt (Guest)
on 2009-03-06 22:41
(Received via mailing list)
In order to get the right answer, you usually have to ask the right
question ;)


On Mar 6, 10:07 pm, "--- Z@m ---" <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.