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.

Help with acts_as_journalized

Added by Simon Stearn at 2012-02-09 03:48 pm

I was trying to throw together a version of the EzFAQ plugin thats been moved onto acts_as_journalized (its only the faq model that is relevant). Just trying to get faq's on the activity feed initially, and maybe present some history later.

I keep getting this error :

NoMethodError in EzfaqController#edit

undefined method `user' for #<FaqJournal:0x1122afe28>
RAILS_ROOT: /Volumes/HDD/Users/simon/Dropbox/Code/exonypsi/chili3

Application Trace | Framework Trace | Full Trace
/Volumes/HDD/Users/simon/Dropbox/Code/exonypsi/chili3/vendor/plugins/acts_as_journalized/lib/redmine/acts/journalized/save_hooks.rb:66:in `reset_instance_variables'
/Users/simon/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:178:in `send'
/Users/simon/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Users/simon/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/callbacks.rb:166:in `call'
.
.

I think the answer is probably in this bit of the chiliproject docs:

https://www.chiliproject.org/projects/chiliproject/wiki/Acts_as_journalized#Journaledjournal_user

Since my skill level with Rails is somewhere between 'absolutely none' and 'hobbyist' I was hoping someone (maybe Eric or Tim) could point me in the right direction. The code for this half-version is here:

https://github.com/simonstearn/ezfaq_plugin

This is the faq model:

https://github.com/simonstearn/ezfaq_plugin/blob/master/app/models/faq.rb

I appreciate any help. Thanks


Replies (4)

RE: Help with acts_as_journalized - Added by Felix Schäfer at 2012-02-11 08:26 pm

The code seems somewhat tortured (the bits that where there before already :-) ), and I especially don't know what (you think) the def FaqJournal::user in Faq should do (it's probably far from what you think it should do…), but I don't see anything really bad in there.

Is this with data created with your worked up version of the plugin, or is it data from a previous install of the Redmine EzFAQ?

RE: Help with acts_as_journalized - Added by Simon Stearn at 2012-02-14 10:53 am

Felix

Thanks for the pointer - there is a problem with the creation of initial journals. When I empty all the tables and just create new FAQs I can edit this ok.

I had put a migration in based on the template:https://www.chiliproject.org/projects/chiliproject/wiki/Acts_as_journalized#Create-initial-journals which seems pretty easy to follow, but I guess I messed up. I'll do some more snooping around to figure out what I got wrong.

Thanks again for taking a look.

RE: Help with acts_as_journalized - Added by Simon Stearn at 2012-02-17 11:48 am

I've finally traced this to the Aptana Studio environment when debugging - it worked with migrated data fine when run from script/server or under RubyMine. Saw someone else complaining about Aptana interaction with bundler and rvm on the web so maybe I'm not the only one with that problem. Anyway its working on chiliproject 3.0.0 now - repository moved to https://github.com/simonstearn/faq_plugin if anyone else wants it.

RE: Help with acts_as_journalized - Added by Felix Schäfer at 2012-02-17 12:43 pm

Great to hear, be sure to add it to the plugin compatibility list in the wiki :-)

(1-4/4)