On Mon, Dec 15, 2008 at 1:13 AM, Michael Kahle <
[email protected]> wrote:

>
> I'll start by apologizing for the title.  I can't think what to call
> this.
>
> I have some Claims that need to be entered, but when they are "closed"
> it saves the data from other related tables into the Claim (this could
> get messy), so that if the Customer, Registration, or Dealer information
> is changed at a later date it will remain the same as when the Claim was
> closed.
>
> Is there a preferred method for doing this?  Some kind of plugin or
> something?
>
> I understand I could have a separate table for keeping the "archived"
> version of the record, but I fear the work to create all new tables and
> then storing the record as this other new archive type which is nothing
> more than a duplicate of the Claim.
>
> Any thoughts?
>
> P.S. - Ask away, I am probably not explaining this perfectly, but I will
> try to elaborate if you are having trouble understanding my challenge.
>
I wonder if you could implement a "copy-on-write" feature in the Customer,
Registration, Dealer, etc... tables.  Basically, add a "freeze_record"
boolean column to those tables and set that to "true" when you need to
finalize one of those records.  If you ever want/need to update a frozen
record, you could allocate a new one, scan all of the claims to which this
record "belongs_to" and point all of those that are not closed to the new
record.

This strikes me as an ideal candidate for some sort of plugin that mixes
into ActiveRecord.  Unfortunately, I haven't the foggiest idea how to
implement the practical side of this theoretical solution (yet... but I'm
learning more every day).

--wpd

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to