diff --git a/app/models/profile.rb b/app/models/profile.rb index 3273a17..48d7188 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -334,7 +334,6 @@ class Profile < ActiveRecord::Base hp.profile = self hp.save! self.home_page = hp - self.save! # a default rss feed feed = RssFeed.new(:name => 'feed') @@ -346,6 +345,7 @@ class Profile < ActiveRecord::Base self.articles << folder end end + self.save! end def copy_articles_from other diff --git a/test/unit/profile_test.rb b/test/unit/profile_test.rb index 8306b99..29560cd 100644 --- a/test/unit/profile_test.rb +++ b/test/unit/profile_test.rb @@ -849,6 +849,7 @@ class ProfileTest < Test::Unit::TestCase Profile.any_instance.stubs(:template).returns(template) p = Profile.create!(:name => 'test_profile', :identifier => 'test_profile') + p.reload assert_not_nil p.home_page assert_equal 'some xyz article', p.home_page.name -- libgit2 0.21.2