diff options
| author | hukl <contact@smyck.org> | 2009-12-01 23:02:39 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-12-01 23:04:06 +0100 |
| commit | 3af611abb212052351f0979b85027adafce87a69 (patch) | |
| tree | 7dd3d23a3346d95f1dd80b2724bcf51297a8896b /app/controllers | |
| parent | 4d3d971452086f375eed953f66f25cfe6e622281 (diff) | |
dramatically reduced instanciated AR objects for tags
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/tags_controller.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index c965443..d235601 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb | |||
| @@ -11,12 +11,13 @@ class TagsController < ApplicationController | |||
| 11 | tag_name = @tag ? @tag.name : nil | 11 | tag_name = @tag ? @tag.name : nil |
| 12 | 12 | ||
| 13 | @page = Page.new | 13 | @page = Page.new |
| 14 | @pages = Page.heads.find_tagged_with( | 14 | @pages = Page.heads.paginate( |
| 15 | tag_name, :order => 'published_at DESC' | 15 | Page.find_options_for_find_tagged_with(tag_name).merge( |
| 16 | ).paginate( | 16 | :order => 'published_at DESC', |
| 17 | :page=>params[:page], | 17 | :page=>params[:page], |
| 18 | :per_page => 23 | 18 | :per_page => 23 |
| 19 | ) | 19 | ) |
| 20 | ) | ||
| 20 | end | 21 | end |
| 21 | 22 | ||
| 22 | end | 23 | end |
