Skip to content
Extraits de code Groupes Projets
Valider 119599bf rédigé par maxwell's avatar maxwell
Parcourir les fichiers

Revert "Commented-on posts bubble up to the top"

This reverts commit 6da41007.
parent 308c6539
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -9,7 +9,7 @@ class AspectsController < ApplicationController
respond_to :json, :only => :show
def index
@posts = current_user.raw_visible_posts.find_all_by__type("StatusMessage", :order => 'updated_at desc').paginate :page => params[:page], :per_page => 15
@posts = current_user.visible_posts(:_type => "StatusMessage").paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
@post_hashes = hashes_for_posts @posts
@aspect_hashes = hashes_for_aspects @aspects.all, @contacts
@aspect = :all
......@@ -62,7 +62,7 @@ class AspectsController < ApplicationController
@aspect_contacts = @aspect.contacts
@aspect_contacts_count = @aspect_contacts.count
@posts = @aspect.posts.find_all_by__type("StatusMessage", :order => 'updated_at desc').paginate :page => params[:page], :per_page => 15
@posts = @aspect.posts.find_all_by__type("StatusMessage", :order => 'created_at desc').paginate :page => params[:page], :per_page => 15
@post_hashes = hashes_for_posts @posts
@post_count = @posts.count
......
......@@ -11,7 +11,7 @@ class PeopleController < ApplicationController
def index
@aspect = :search
@people = Person.search(params[:q]).paginate :page => params[:page], :per_page => 25, :order => 'updated_at DESC'
@people = Person.search(params[:q]).paginate :page => params[:page], :per_page => 25, :order => 'created_at DESC'
@requests = Request.all(:to_id.in => @people.map{|p| p.id})
#only do it if it is an email address
......@@ -39,7 +39,7 @@ class PeopleController < ApplicationController
@aspects_with_person = @contact.aspects
end
@posts = current_user.visible_posts(:person_id => @person.id, :_type => "StatusMessage").paginate :page => params[:page], :order => 'updated_at DESC'
@posts = current_user.visible_posts(:person_id => @person.id, :_type => "StatusMessage").paginate :page => params[:page], :order => 'created_at DESC'
@post_hashes = hashes_for_posts @posts
respond_with @person, :locals => {:post_type => :all}
......
......@@ -21,7 +21,7 @@ class PhotosController < ApplicationController
@aspects_with_person = @contact.aspects
end
@posts = current_user.raw_visible_posts.all(:_type => 'Photo', :person_id => @person.id, :order => 'updated_at DESC').paginate :page => params[:page], :order => 'created_at DESC'
@posts = current_user.raw_visible_posts.all(:_type => 'Photo', :person_id => @person.id, :order => 'created_at DESC').paginate :page => params[:page], :order => 'created_at DESC'
render 'people/show'
......
......@@ -36,11 +36,6 @@ class Comment
validates_presence_of :text, :diaspora_handle, :post
validates_with HandleValidator
after_create do
#save the parent post to update updated_at timestamp
post.save
end
before_save do
get_youtube_title text
end
......
......@@ -70,15 +70,6 @@ describe Comment do
user2.comment "sup dog", :on => @status
@status.reload.comments.first.text.should == "sup dog"
end
it "updates updated_at of parent post on creation" do
hash = @status.to_mongo
hash[:updated_at] = (Time.now - 20).to_s
@status.collection.save(hash)
user2.comment "sup dog", :on => @status
@status.reload.updated_at.should == @status.comments.first.created_at
end
end
it 'should not send out comments when we have no people' do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter