From 2758ea1625f6693c15e25c9164cb9c644a70a770 Mon Sep 17 00:00:00 2001 From: danielvincent <danielgrippi@gmail.com> Date: Thu, 16 Dec 2010 17:24:06 -0800 Subject: [PATCH] fixed issue with diaspora handles not displaying in streams --- app/controllers/aspects_controller.rb | 4 ++-- app/models/person.rb | 2 +- app/models/photo.rb | 10 ---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 3a436dc48c..0b278535b3 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -170,7 +170,7 @@ class AspectsController < ApplicationController private def hashes_for_contacts contacts - people = Person.all(:id.in => contacts.map{|c| c.person_id}, :fields => [:profile]) + people = Person.all(:id.in => contacts.map{|c| c.person_id}, :fields => [:profile, :diaspora_handle]) people_hash = {} people.each{|p| people_hash[p.id] = p} contacts.map{|c| {:contact => c, :person => people_hash[c.person_id.to_id]}} @@ -201,7 +201,7 @@ class AspectsController < ApplicationController photo_hash = Photo.hash_from_post_ids post_ids post_person_ids.uniq! - posters = Person.all(:id.in => post_person_ids, :fields => [:profile, :owner_id]) + posters = Person.all(:id.in => post_person_ids, :fields => [:profile, :owner_id, :diaspora_handle]) posters_hash = {} posters.each{|poster| posters_hash[poster.id] = poster} diff --git a/app/models/person.rb b/app/models/person.rb index db0a4fa4c5..50816bbeb3 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -161,7 +161,7 @@ class Person def self.from_post_comment_hash(hash) person_ids = hash.values.flatten.map!{|c| c.person_id}.uniq - people = where(:id.in => person_ids).fields(:profile) + people = where(:id.in => person_ids).fields(:profile, :diaspora_handle) people_hash = {} people.each{|p| people_hash[p.id] = p} people_hash diff --git a/app/models/photo.rb b/app/models/photo.rb index 3173f8719d..6b5232fb41 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -119,16 +119,6 @@ class Photo < Post where(:status_message_id.in => post_ids) } -=begin - private - def delete_parent_if_no_photos_or_message - parent = self.status_message - photos = parent.photos || [] - if parent.message.blank? && photos.count <= 1 - parent.delete - end - end -=end end -- GitLab