added a setting option to set the feeds content limit

git-svn-id: http://redmine.rubyforge.org/svn/trunk@346 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-03-18 18:32:59 +00:00
parent d967bb4a54
commit 143be7ee02
10 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ class FeedsController < ApplicationController
# news feeds
def news
News.with_scope(:find => @find_options) do
@news = News.find :all, :order => "#{News.table_name}.created_on DESC", :limit => 10, :include => [ :author, :project ]
@news = News.find :all, :order => "#{News.table_name}.created_on DESC", :include => [ :author, :project ]
end
headers["Content-Type"] = "application/rss+xml"
render :action => 'news_atom' if 'atom' == params[:format]
@@ -94,7 +94,7 @@ private
# global feed
scope = ["#{Project.table_name}.is_public=?", true]
end
@find_options = {:conditions => scope, :limit => 10}
@find_options = {:conditions => scope, :limit => Setting.feeds_limit}
return true
end
end