diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-10 07:32:51 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-10 07:32:51 +0000 |
commit | c47fc026601d86457d2ad306f856a8098dfe0e2d (patch) | |
tree | ec36356945c84248ade22d38b1cd1bb72ca4ac93 /app/controllers/track_controller.rb | |
parent | 5e48e9204b5cb990cba7e7f6a12f0387e097d046 (diff) | |
parent | 6965a59ab403e2139d5405507f8e4e92579caae2 (diff) |
Merge branch 'release/0.5' of github.com:sebbacon/alaveteli into 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' |