ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Track initial attributes in a Journal when created (Bug #445)


Added by Eric Davis at 2011-06-03 08:01 pm. Updated at 2011-06-10 05:59 pm.


Status:Closed Start date:2011-06-03
Priority:Normal Due date:
Assignee:Eric Davis % Done:

0%

Category:Journals / History
Target version:2.0.0
Remote issue URL: Affected version:unstable

Description

Quite a few things here. I'm not sure which is intended, which are bugs, and which are new features.

When an issue is created there is an initial journal created for it. In #442 Felix and I thought about putting the initial changes into that journal to track the object state at creation. (i.e. "This issue was created with these attributes").

Did some digging and got this working with a small change to acts_as_journalized. (vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/changes.rb and test/unit/journal_test.rb)

But I also discovered that the main migration (db/migrate/20100714111651_generalize_journals.rb) isn't correctly creating initial journals for all objects. Specifically an object that doesn't have any existing Journals (e.g. Issue without an update). I've rebuilt part of that migration to create initial journals for them and also tried to "guess" what the creation attributes are. It appears working on my test data but because it's a heavy migration, I'd like a second (or third opinion). An improvement would be to walk the object history to figure out what the actual creation values should have been (i.e. reverse changes over time).

Pull request and branch coming up soon.

Related to #442


Associated revisions

Revision 33e3a713
Added by Eric Davis at 2011-06-03 10:01 pm

[#445] Track initial object attributes on the initial journal

So the initial journal would have the changes from an Object#new
to the created version of the Object. Also includes a change to the
database migration in order to create these initial journals for
all journaled Objects.

History

Updated by Eric Davis at 2011-06-03 08:07 pm

  • Status changed from Open to Ready for review

Updated by Eric Davis at 2011-06-10 05:59 pm

Merged pull request into release-v2.0.0.

If we need to change the migration for the initial journals, I think we should extract that code into Journal so the initial journals can be "rebuilt" without having to rerun the migration.

  • Status changed from Ready for review to Closed

Also available in: Atom PDF