Defect #14773

ActiveRecord::Acts::Versioned::ActMethods#next_version Generates ArgumentError

Added by Justin Leishman about 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:2.4.0
Resolution:Fixed Affected version:2.3.2

Description

There's a patch already available here. I'm not sure why the WikiContent model doesn't break, but it does customize the WikiContent::Version class's behavior slightly.

Associated revisions

Revision 12222
Added by Jean-Philippe Lang about 4 years ago

Fixed that WikiContent#next_version raises a comparison of Symbol with Arel::Table failed error (#14773).

History

#1 Updated by Justin Leishman about 4 years ago

Apparently setting self.locking_column = 'version' gets around this problem, but I don't see it documented anywhere.

#2 Updated by Mischa The Evil about 4 years ago

This is also discussed in Error While saving Wiki (Arel::Table failed) acts_as_vers.... What is missing is a clear way how to reproduce the error.

Justin Leishman wrote:

Apparently setting self.locking_column = 'version' gets around this problem, but I don't see it documented anywhere.

self.locking_column = 'version' is 'available' in source:/trunk/app/models/wiki_content.rb#L21. I don't see how that is related.

#3 Updated by Leandro Guida about 4 years ago

Ok. The patch fixed my problem.

#4 Updated by Jean-Philippe Lang about 4 years ago

  • Category set to Code cleanup/refactoring
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.4.0
  • Resolution set to Fixed

I was not able to trigger this error from within Redmine but I WikiContent#next_version actually raises this error.
Fix applied in r12222.

Also available in: Atom PDF