From 4e30313cd248d398552178c6cb338fb9887ec4d3 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 31 May 2009 17:33:41 -0300 Subject: [PATCH] Rails 2.1 does not resist passing nil to update_attributes --- app/models/blog.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/models/blog.rb b/app/models/blog.rb index 130103b..b9228ef 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb @@ -45,11 +45,14 @@ class Blog < Folder end def feed=(attrs) - if self.feed - self.feed.update_attributes(attrs) - else - self.feed_attrs = attrs + if attrs + if self.feed + self.feed.update_attributes(attrs) + else + self.feed_attrs = attrs + end end + self.feed end def posts_list(npage) -- libgit2 0.21.2