don't dispatch photos twice ...

This commit is contained in:
Benjamin Neff 2015-06-07 02:56:34 +02:00 committed by Dennis Schubert
parent c75f92d07a
commit ed10bea21f
2 changed files with 1 additions and 5 deletions

View file

@ -73,11 +73,6 @@ class StatusMessagesController < ApplicationController
current_user.dispatch_post(@status_message, :url => short_post_url(@status_message.guid), :service_types => receiving_services)
#this is done implicitly, somewhere else, but it doesnt work, says max. :'(
@status_message.photos.each do |photo|
current_user.dispatch_post(photo)
end
current_user.participate!(@status_message)
if coming_from_profile_page? && !own_profile_page? # if this is a post coming from a profile page

View file

@ -116,6 +116,7 @@ class StatusMessage < Post
def update_and_dispatch_attached_photos(sender)
if self.photos.any?
logger.info "dispatch photos for StatusMessage:#{guid}"
Photo.where(status_message_guid: guid).update_all(:public => self.public)
self.photos.each do |photo|
if photo.pending