views:

117

answers:

2

Something like act_as_taggable or act_as_versioned but for SAP style effective dating?

Sorry for the lack of details. Here is some more:

The plugin would add a start_date and end_date to a model.

  • Basic operation should always be on entity valid for today or a parameter date
  • Update should make a copy of the effective entity with a start date of now and update the existing entity to set the end date now
  • Delete should just set the end date to now on the existing entity
  • Probably many more, but those cover the basic idea.

This is the way SAP handles versioning of entities. Does anyone knows of a plugin that does something similar?

A: 

I recommend you add some more details or clarification before the wrath of SO descends upon you.

Troggy
A: 

This is a tough problem. This means that every change you make to your tables take an "effective date" parameter. For example: Person X will be moving to a new address effective a month from now. So when you query the table today, you see the current address. If you were to query with an effective date of a month from now, you would see the new address.

And that goes for everything you enter in the app. Everything has a concept of when it became a fact. And you can see the values at any point in time, exactly as they were.

We are in the midst of finishing a rails project addressing this issue in an HR app. we will post something once this is completed.

Alberto Morales
Thank you, for this update. I'll be interested in any development.
jfno