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.

AAJ does not create journals, when models are created using sub classes (Bug #708)


Added by Gregor Schmidt at 2011-11-17 09:47 am. Updated at 2011-12-10 09:54 pm.


Status:Closed Start date:2011-11-17
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

Category:Journals / History
Target version:2.6.0
Remote issue URL: Affected version:2.4.0

Description

In chiliproject_backlogs, we are using custom subclasses of the Issue model. The subclasses contain some custom behavior, that is used in the plugin's code. This way we do not need to add them to the global Issue model. Also, we can have different behavior for Stories, Tasks and Impediments.

This worked fine, when using Chili 1.x. With the introduction of acts_as_journalized, we were running into a problem. AAJ derives the Journal class' name from the instance's class name. This will not work correctly, when dealing with the instances of subclasses.

The code within the pull request, that will be attached, changes AAJ, so that only models, with direct calls to acts_as_journalized have Journal classes. All subclasses, that do not call acts_as_journalized directly, will use their parent class' one.


Associated revisions

Revision e2938d26
Added by Gregor Schmidt at 2011-11-17 11:16 am

[#708] Using instance var to store journal class name

this way journal classes are only created for classes with
calls to acts_as_journalized. You may now subclass journaled models to extend them with helper methods in plugins w/o interfering with aaj.

Revision fb7f109a
Added by Gregor Schmidt at 2011-11-17 11:17 am

[#708] Adding tests exposing the erroneous behavior

Revision ba0ded88
Added by Felix Schäfer at 2011-12-09 10:36 pm

Merge pull request #125 from finnlabs/pulls/708/journal_class_name_in_attribute

Bug #708: AAJ does not create journals, when models are created using sub classes

History

Updated by Gregor Schmidt at 2011-11-17 09:52 am

The bug results in an error message printed to standard out and the journal will silently not be created. This is handled by L134 in aaj/lib/redmine/acts/journalized/creation.rb

Updated by Gregor Schmidt at 2011-11-17 10:20 am

The pull request may be found at https://github.com/chiliproject/chiliproject/pull/125.

We would love to see this in the core, since only then people could start using chiliproject_backlogs without the need to patch the core.

Thanks,

Gregor

  • Assignee deleted (Gregor Schmidt)
  • Status changed from Open to Ready for review

Updated by Felix Schäfer at 2011-12-01 05:08 pm

This looks good to me, staged for 2.6.0, but I'd like to give Eric and Holger the chance to have a look before merging it.

  • Target version set to 2.6.0

Updated by Felix Schäfer at 2011-12-09 09:37 pm

Merged in ba0ded8, I'll wait for the CI to test it through to close here.

  • Assignee set to Felix Schäfer

Updated by Eric Davis at 2011-12-10 09:54 pm

I'm going to close this. We can reopen or create a new issue if there are problems later on.

  • Status changed from Ready for review to Closed

Also available in: Atom PDF