https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292015-05-27T14:39:37ZRedmineRedmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639162015-05-27T14:39:37ZToshi MARUYAMA
<ul></ul><p><a class="external" href="https://github.com/redmine/redmine/pull/55">https://github.com/redmine/redmine/pull/55</a></p>
<blockquote>
<p>I noticed exceptions when plugin use acts_as_versioned because of ActiveRecord.</p>
</blockquote> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639172015-05-27T14:42:29ZToshi MARUYAMA
<ul></ul><p>It seems acts_as_versioned is dead.<br /><a class="external" href="https://github.com/JoelJuliano/acts_as_versioned">https://github.com/JoelJuliano/acts_as_versioned</a></p>
<p>I think we would better use paper_trail gem instead.<br /><a class="external" href="https://github.com/airblade/paper_trail">https://github.com/airblade/paper_trail</a></p> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639182015-05-27T14:51:12ZToshi MARUYAMA
<ul><li><strong>Target version</strong> set to <i>3.0.4</i></li></ul><p><a class="external" href="https://patch-diff.githubusercontent.com/raw/redmine/redmine/pull/55.diff">https://patch-diff.githubusercontent.com/raw/redmine/redmine/pull/55.diff</a><br /><pre><code class="diff syntaxhl"><span class="gh">diff --git a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb
index 618cf07..224a0c7 100644
</span><span class="gd">--- a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb
</span><span class="gi">+++ b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb
</span><span class="p">@@ -447,7 +447,7 @@</span> def clear_altered_attributes
def write_changed_attribute(attr_name, attr_value)
# Convert to db type for comparison. Avoids failing Float<=>String comparisons.
<span class="gd">- attr_value_for_db = self.class.columns_hash[attr_name.to_s].type_cast(attr_value)
</span><span class="gi">+ attr_value_for_db = self.class.columns_hash[attr_name.to_s].type_cast_from_database(attr_value)
</span> (self.altered_attributes ||= []) << attr_name.to_s unless self.changed?(attr_name) || self.send(attr_name) == attr_value_for_db
write_attribute(attr_name, attr_value_for_db)
end
</code></pre></p> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639202015-05-27T14:53:09ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/19959">Feature #19959</a>: use paper_trail gem instead of bundled acts_as_versioned</i> added</li></ul> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639502015-05-30T08:27:05ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li></ul><p>Can we have a test that triggers this error in Redmine?</p> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639522015-05-30T08:34:30ZToshi MARUYAMA
<ul></ul><p>Jean-Philippe Lang wrote:</p>
<blockquote>
<p>Can we have a test that triggers this error in Redmine?</p>
</blockquote>
<p>I think we don't use this code, so we cannot test.<br />We cannot manage unused code of bundled gem, so we should use maintained gem instead (<a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: use paper_trail gem instead of bundled acts_as_versioned (Closed)" href="https://www.redmine.org/issues/19959">#19959</a>).</p> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=639672015-05-31T07:20:09ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> set to <i>Rails support</i></li><li><strong>Status</strong> changed from <i>Needs feedback</i> to <i>Resolved</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Patch committed.</p> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=641762015-06-13T11:10:29ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li></ul> Redmine - Defect #19957: acts_as_versioned not compatible with ActiveRecord 4.2.1https://www.redmine.org/issues/19957?journal_id=744542016-11-14T15:45:37ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/24348">Defect #24348</a>: acts_as_versioned use old style (Rails 2.x) of method call for #all</i> added</li></ul>