From 3eeb81ad3453bf37c8a71319948567dd8fe0c34c Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 29 Jul 2010 20:43:03 -0700 Subject: [PATCH] DG IZ; time_created_at uses published_at instead of created_at for OstatusPost --- app/controllers/authors_controller.rb | 2 +- app/controllers/dashboards_controller.rb | 2 +- app/helpers/application_helper.rb | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index f4e6b80c7..bf88844b8 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -3,7 +3,7 @@ class AuthorsController < ApplicationController def show @author= Author.where(:id => params[:id]).first - @author_ostatus_posts = @author.ostatus_posts.paginate :page => params[:page], :order => 'created_at DESC' + @author_ostatus_posts = @author.ostatus_posts.paginate :page => params[:page], :order => 'published_at DESC' end diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb index 414f5956a..fe09cfa5c 100644 --- a/app/controllers/dashboards_controller.rb +++ b/app/controllers/dashboards_controller.rb @@ -7,7 +7,7 @@ class DashboardsController < ApplicationController end def ostatus - @posts = OstatusPost.paginate :page => params[:page], :order => 'created_at DESC' + @posts = OstatusPost.paginate :page => params[:page], :order => 'published_at DESC' render :index end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2a9d7eda2..88a54e4c6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,7 +17,11 @@ module ApplicationHelper end def how_long_ago(obj) - time_ago_in_words(obj.created_at) + " ago." + if obj.is_a? OstatusPost + "#{time_ago_in_words(obj.published_at)} ago" + else + "#{time_ago_in_words(obj.created_at)} ago." + end end def person_url(person)