Forum: Ruby on Rails NEED HELP

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.
anton effendi (Guest)
on 2009-01-07 06:37
(Received via mailing list)
Hai guys.
I have problem in Rails.. Can u help me? please.....

My problem:

I want to make code for maintenance database... I want like migration...
can
change to another version...
so when I import some data, I must revert to before version..

example:
file import 1 --> import to database... version 1
 user1 add some data
file import 2 --> import to database... version 2
 user2 add some data
file import 3 --> import to database... version 3

if file import 3 wrong data...., then I can change to version2 with some
data form user2.(last data base before file import3 exceuted)


do anybody know about it?? if must use plugin.. what are they??


Thank you.


--
Wu You Duan
Vishwanath N. (Guest)
on 2009-01-07 21:46
(Received via mailing list)
hi,

You can use Transaction functionality for the same
Eg:
User.transaction do
....
....
end
if anything fails in between, everything will be reverted

-NAYAK
Matt H. (Guest)
on 2009-01-07 23:03
(Received via mailing list)
anton effendi wrote:
> file import 1 --> import to database... version 1
>  user1 add some data
> file import 2 --> import to database... version 2
>  user2 add some data
> file import 3 --> import to database... version 3
>
> if file import 3 wrong data...., then I can change to version2 with some
> data form user2.(last data base before file import3 exceuted)
>
>
> do anybody know about it?? if must use plugin.. what are they??

Have you looked at acts_as_versioned? I'm not totally sure what you're
trying to do but that might work for you.

HTH

Matt
This topic is locked and can not be replied to.