diff --git a/app/models/rss_feed.rb b/app/models/rss_feed.rb index b42ac4d..2de235d 100644 --- a/app/models/rss_feed.rb +++ b/app/models/rss_feed.rb @@ -28,16 +28,16 @@ class RssFeed < Article self.body[:feed_item_description] = feed_item_description end - # The maximum number of articles to be displayed in the RSS feed. Default: 10 - def limit - settings[:limit] || 10 - end - def limit=(value) + settings_items :limit, :type => :integer, :default => 10 + + def limit_with_body_change=(value) #UPGRADE Leandro: I add this line to save the serialize attribute self.body_will_change! - settings[:limit] = value + self.limit_without_body_change= value end + alias_method_chain :limit=, :body_change + # FIXME this should be validates_numericality_of, but Rails 2.0.2 does not # support validates_numericality_of with virtual attributes validates_format_of :limit, :with => /^\d+$/, :if => :limit -- libgit2 0.21.2