Need help


#1

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


#2

hi,

You can use Transaction functionality for the same
Eg:
User.transaction do


end
if anything fails in between, everything will be reverted

-NAYAK


#3

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