diff options
author | francis <francis> | 2008-04-09 02:51:45 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-09 02:51:45 +0000 |
commit | b1e7902fdfe8f1ee1152e11094df15ad4f28df7e (patch) | |
tree | 7aab23e2ec16f1db7b70591de4b7dbd21e1e913d /app/controllers/admin_controller.rb | |
parent | c1478a025bf24476c02e87680c3e882f497cd662 (diff) |
Include public body history change in timeline
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r-- | app/controllers/admin_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index f9293d473..3718b0bd2 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_controller.rb,v 1.8 2008-04-03 19:45:47 francis Exp $ +# $Id: admin_controller.rb,v 1.9 2008-04-09 02:51:46 francis Exp $ class AdminController < ApplicationController layout "admin" @@ -36,6 +36,14 @@ class AdminController < ApplicationController end @events = InfoRequestEvent.find(:all, :order => "created_at desc, id desc", :conditions => ["created_at > ? ", date_back_to]) + @public_body_history = PublicBody.versioned_class.find(:all, :order => "updated_at desc, id desc", + :conditions => ["updated_at > ? ", date_back_to]) + for pbh in @public_body_history + pbh.created_at = pbh.updated_at + end + @events += @public_body_history + + @events.sort! { |a,b| b.created_at <=> a.created_at } end end |