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.
Accessing version of newly created WikiContent results in NoMethodError (Bug #537)
Description
When executing the following code, I'm getting 0
in Chili 1.x while I get an error in Chili 2.0:
WikiContent.new.version
The error output looks like the following
NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.update_attribute from app/models/wiki_content.rb:65:in `version' from (irb):2
The code creates an initial journal - which involves a db update - which seems to be wrong since I did not save anything up to this point. I think, the version
method should simply return 0
for new records.
A pull request including a new test is attached.
Associated revisions
[#537] version of new WikiContents should be 0
History
Updated by Gregor Schmidt at 2011-07-25 02:52 pm
The pull request is at https://github.com/chiliproject/chiliproject/pull/84
Updated by Gregor Schmidt at 2011-07-25 02:52 pm
- Status changed from Open to Ready for review
Updated by Holger Just at 2011-07-25 05:10 pm
Pushed to master
. Thanks Gregor!
- Subject changed from Accessing @version@ of newly create WikiContent results in NoMethodError to Accessing version of newly created WikiContent results in NoMethodError
- Assignee set to Holger Just
- Status changed from Ready for review to Closed