From 31fdbc17f07401adba119f62a15c17c0928429ed Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 26 Nov 2007 01:51:19 +0000 Subject: [PATCH] ActionItem93: putting acts_as_versioned again; the problem was that acts_as_filesystem was returning false in an ActiveRecord callback --- lib/acts_as_filesystem.rb | 2 ++ test/unit/article_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/acts_as_filesystem.rb b/lib/acts_as_filesystem.rb index 894f301..4016337 100644 --- a/lib/acts_as_filesystem.rb +++ b/lib/acts_as_filesystem.rb @@ -24,6 +24,7 @@ module ActsAsFileSystem if record.path == record.slug && (! record.top_level?) record.path = record.calculate_path end + true end # when renaming a category, all children categories must have their paths @@ -37,6 +38,7 @@ module ActsAsFileSystem end end record.recalculate_path = false + true end end diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index ffce196..f8e6231 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -33,10 +33,10 @@ class ArticleTest < Test::Unit::TestCase should 'act as versioned' do a = Article.create!(:name => 'my article', :body => 'my text', :profile_id => profile.id) - assert_equal 1, a.versions.size + assert_equal 1, a.versions(true).size a.name = 'some other name' a.save! - assert_equal 2, a.versions.size + assert_equal 2, a.versions(true).size end should 'act as taggable' do -- libgit2 0.21.2