Permalink
Browse files

tweaking around to avoid a bug

  • Loading branch information...
1 parent 9bc7f57 commit afbf242f7162011a9876fb1bebb999ae3de31438 @mcansky committed May 17, 2011
Showing with 10 additions and 2 deletions.
  1. +10 −2 app/controllers/posts_controller.rb
@@ -41,9 +41,17 @@ def index
limit = -1
end
if user
- posts = user.bookmarks.tagged_with(params[:tag]).find(:all, :offset => (params[:start] || 0), :limit => (params[:results] || limit), :conditions => conditions, :order => "bookmarked_at DESC")
+ if limit == ("ALL" || -1)
+ posts = user.bookmarks.tagged_with(params[:tag]).find(:all, :offset => (params[:start] || 0), :conditions => conditions, :order => "bookmarked_at DESC")
+ else
+ posts = user.bookmarks.tagged_with(params[:tag]).find(:all, :offset => (params[:start] || 0), :limit => (params[:results] || limit), :conditions => conditions, :order => "bookmarked_at DESC")
+ end
else
- posts = Bookmark.tagged_with(params[:tag]).find(:all, :offset => (params[:start] || 0), :limit => (params[:results] || limit), :conditions => conditions, :order => "bookmarked_at DESC")
+ if limit == ("ALL" || -1)
+ posts = Bookmark.tagged_with(params[:tag]).find(:all, :offset => (params[:start] || 0), :conditions => conditions, :order => "bookmarked_at DESC")
+ else
+ posts = Bookmark.tagged_with(params[:tag]).find(:all, :offset => (params[:start] || 0), :limit => (params[:results] || limit), :conditions => conditions, :order => "bookmarked_at DESC")
+ end
end
else
if user

0 comments on commit afbf242

Please sign in to comment.