Commit 4e30313cd248d398552178c6cb338fb9887ec4d3

Authored by Antonio Terceiro
Committed by Antonio Terceiro
1 parent 6487d6f8

Rails 2.1 does not resist passing nil to update_attributes

Showing 1 changed file with 7 additions and 4 deletions   Show diff stats
app/models/blog.rb
... ... @@ -45,11 +45,14 @@ class Blog < Folder
45 45 end
46 46  
47 47 def feed=(attrs)
48   - if self.feed
49   - self.feed.update_attributes(attrs)
50   - else
51   - self.feed_attrs = attrs
  48 + if attrs
  49 + if self.feed
  50 + self.feed.update_attributes(attrs)
  51 + else
  52 + self.feed_attrs = attrs
  53 + end
52 54 end
  55 + self.feed
53 56 end
54 57  
55 58 def posts_list(npage)
... ...