lib/stream/fires.rb in Stream-0.1.7 vs lib/stream/fires.rb in Stream-0.1.8
- old
+ new
@@ -43,12 +43,13 @@
photo = activity.subject
# Find recent photo activity
last_activity = ActivityItem.find(:first, :conditions => ["subject_type = ? AND subject_id = ? AND DATE(updated_at) = current_date",
photo.class,photo.id])
- unless last_activity && (activity.subject.gallery.eql?(last_activity.subject.gallery))
+ unless last_activity && (gallery.eql?(last_activity.subject.gallery))
([activity.actor] + gallery.allowed_contacts).each do |p|
activity.is_hidden = !p.subject.approval_status
+ activity.photos << activity.subject
activity.save
p.activity_items << activity
end
else
last_activity.photos << activity.subject