ActiveAdmin.register JamRuby::CrashDump, :as => 'Crash Dump' do 
  # Note: a lame thing is it's not obvious how to make it search on email instead of user_id.
  filter :timestamp
  filter :user_email, :as => :string
  filter :client_id

  index do
    column "Timestamp" do |post|
      post.timestamp.strftime('%b %d %Y, %H:%M')
    end
    column "Client Type", :client_type
    column "Dump URL" do |post|
      link_to post.uri, post.uri
    end

    column "User ID", :user_id

    # FIXME (?): This isn't performant (though it likely doesn't matter). Could probably do a join.
    column "User Email" do |post|
      unless post.user_id.nil?
        post.user_email
      end
    end
    column "Client ID", :client_id
    actions
  end
end
