diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-02-03 13:38:59 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-02-03 13:38:59 +0000 |
commit | 44bb96d40758f3b8bb9da20e3037ff2f04e81327 (patch) | |
tree | 2f43c9c02205fec1fb68cdcb66735d5b1ee3172f /app/controllers/track_controller.rb | |
parent | 7ed887f0989425d9e412890800df05637b08c025 (diff) | |
parent | 14b5be69dc2dc3c4dd817feb0b5a8402fc343db4 (diff) |
Merge branch 'release/0.5'
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r-- | app/controllers/track_controller.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index e06701a5f..e39a0489d 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -46,7 +46,14 @@ class TrackController < ApplicationController # Track all updates to a particular public body def track_public_body - @public_body = PublicBody.find_by_url_name(params[:url_name]) + @public_body = PublicBody.find_by_url_name_with_historic(params[:url_name]) + raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil? + # If found by historic name, or alternate locale name, redirect to new name + if @public_body.url_name != params[:url_name] + redirect_to track_public_body_url(:url_name => @public_body.url_name, :feed => params[:feed]) + return + end + @track_thing = TrackThing.create_track_for_public_body(@public_body) return atom_feed_internal if params[:feed] == 'feed' |