diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 3a436dc48c083bd45e3db62137fede06e6154ddb..0b278535b32bda01f9073a4e77e92a2f83741f03 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 db0a4fa4c5345eb17a9821b3871055681ce5718a..50816bbeb34b3ef7e82530a4fe8d6c0277f9f80b 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 3173f8719dfebe92ed680cf8bb9ca56462f0ce63..6b5232fb41e5f6f8b6e3830aab5baa88d9f9bca3 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