Skip to content
Extraits de code Groupes Projets
Valider cb13d30a rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Directly query photos when doing an update_all

For some reason it doesn't correctly set the bind variables
when called through an association with non-standard
keys. Probably a Rails bug.
parent 35b17d8c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -116,14 +116,14 @@ class StatusMessage < Post ...@@ -116,14 +116,14 @@ class StatusMessage < Post
def update_and_dispatch_attached_photos(sender) def update_and_dispatch_attached_photos(sender)
if self.photos.any? if self.photos.any?
self.photos.update_all(:public => self.public) Photo.where(status_message_guid: guid).update_all(:public => self.public)
self.photos.each do |photo| self.photos.each do |photo|
if photo.pending if photo.pending
sender.add_to_streams(photo, self.aspects) sender.add_to_streams(photo, self.aspects)
sender.dispatch_post(photo) sender.dispatch_post(photo)
end end
end end
self.photos.update_all(:pending => false) Photo.where(status_message_guid: guid).update_all(:pending => false)
end end
end end
......
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