I am looking at using acts_as_versioned to manage revisions of data in

several tables in my application. However, the default behavior of

acts_as_versioned appears to apply to individual rows within a table.

The

tables I want to version are complicated lookup tables and what I really

want is to version the entire contents of each table as a single set.

Adding a row, deleting a row, or updating one or more rows should update

the

version of all rows. Is there a way to use acts_as_versioned to

accomplish

this? Is there a different approach that anyone can recommend?

The second part of this question stems from a bit of self-doubt as to

whether I took a sensible approach with these tables. Essentially what

I

have is the following table (c1…c3 represent criteria, r represents

result)

for each set of criteria:

## r c1 c2 c3

1 1 1 1

1 1 1 0

0 1 0 1

1 1 0 0

0 0 1 1

0 0 1 0

0 0 0 1

0 0 0 0

This allows me to select a result as follows myresult =

mylookup.find(:conditions

=> [“c1 = ?”, “c2 = ?”, “c3 = ?”, a, b, c]).r

In this example, r is true when c1 is true and c3 is false or when c1 is

true and c2 and c3 are true.

This example is extremely simplified in the hopes of conveying the

concept.

The actual criteria tables include 5 or 6 conditions, some boolean, some

integer.

The reason that I would like to version the contents of this table as a

set

(all move to the next revision when one changes) is that I plan to store

the

revision of the criteria used along with the thing being evaluated.

This

should allow me to determine why an evaluated item failed or passed the

criteria even in the future when the criteria have changed (possibly

changing the evaluation result) by simply requesting the criteria for

the

revision that was originally used to evaluate the item in question.

I chose to put the criteria into tables instead of directly into models

because I want to allow the system administrators to update the criteria

in

the future through the application.

Any ideas on other approaches?