diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index bff20bb07..e6cec16a3 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -54,7 +54,7 @@ class TagsController < ApplicationController @posts = StatusMessage.all_public end - @posts = @posts.tagged_with(params[:name]).for_a_stream(max_time) + @posts = @posts.tagged_with(params[:name]).for_a_stream(max_time, 'created_at') @commenting_disabled = true params[:prefill] = "##{params[:name]} " diff --git a/app/models/post.rb b/app/models/post.rb index 394b6d45e..b4037e4d6 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -42,7 +42,7 @@ class Post < ActiveRecord::Base limit(15) end - def by_max_time(max_time, order='created_at') + def self.by_max_time(max_time, order='created_at') where("posts.#{order} < ?", max_time).order("posts.#{order} desc") end #############