diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
| commit | 9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch) | |
| tree | 8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /app/controllers/rss_controller.rb | |
| parent | 85a01e35274b8d4d4165a7b26bd7986e211246bb (diff) | |
| parent | 1853082fcd8c067390c246f9daa01a9b47387497 (diff) | |
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'app/controllers/rss_controller.rb')
| -rw-r--r-- | app/controllers/rss_controller.rb | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/app/controllers/rss_controller.rb b/app/controllers/rss_controller.rb index acffc0e..4b47218 100644 --- a/app/controllers/rss_controller.rb +++ b/app/controllers/rss_controller.rb | |||
| @@ -1,19 +1,21 @@ | |||
| 1 | class RssController < ApplicationController | 1 | class RssController < ApplicationController |
| 2 | 2 | ||
| 3 | before_filter :authenticate, :only => :recent_changes | 3 | before_action :authenticate, :only => :recent_changes |
| 4 | before_filter :get_host | 4 | before_action :get_host |
| 5 | 5 | ||
| 6 | def updates | 6 | def updates |
| 7 | expires_in 31.minutes, :public => true | 7 | expires_in 31.minutes, :public => true |
| 8 | 8 | ||
| 9 | I18n.locale = :de | 9 | I18n.locale = :de |
| 10 | 10 | ||
| 11 | @items = Page.heads.find_tagged_with( | 11 | @items = Page.heads |
| 12 | "update", | 12 | .joins("JOIN taggings ON taggings.taggable_id = pages.id |
| 13 | :order => "published_at DESC", | 13 | AND taggings.taggable_type = 'Page' |
| 14 | :limit => 20 | 14 | AND taggings.context = 'tags'") |
| 15 | ) | 15 | .joins("JOIN tags ON tags.id = taggings.tag_id") |
| 16 | 16 | .where("LOWER(tags.name) = ?", "update") | |
| 17 | .order("published_at DESC").limit(20) | ||
| 18 | |||
| 17 | respond_to do |format| | 19 | respond_to do |format| |
| 18 | format.xml {} | 20 | format.xml {} |
| 19 | format.rdf {} | 21 | format.rdf {} |
| @@ -21,13 +23,9 @@ class RssController < ApplicationController | |||
| 21 | end | 23 | end |
| 22 | 24 | ||
| 23 | def recent_changes | 25 | def recent_changes |
| 24 | @items = Page.all( | 26 | @items = Page.where( |
| 25 | :limit => 20, | 27 | "updated_at < ? AND updated_at > ?", Time.now, Time.now - 14.days |
| 26 | :order => "updated_at desc", | 28 | ).limit(20).order("updated_at desc") |
| 27 | :conditions => [ | ||
| 28 | "updated_at < ? AND updated_at > ?", Time.now, Time.now-14.days | ||
| 29 | ] | ||
| 30 | ) | ||
| 31 | end | 29 | end |
| 32 | 30 | ||
| 33 | protected | 31 | protected |
