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.
7e35ecb8cb04c4c15cf0ad1a0edf113d?d=identicon&s=25 anton effendi (Guest)
on 2009-01-07 05: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
9cf6e7f81d4339295b86e5fb7d7df49b?d=identicon&s=25 Vishwanath Nayak (nayak)
on 2009-01-07 20: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
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2009-01-07 22: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.