lib/stream/fires.rb in Stream-0.1.5 vs lib/stream/fires.rb in Stream-0.1.6
- old
+ new
@@ -33,10 +33,14 @@
create_options[:activity_type] = activity_type.to_s
transaction do
activity = ActivityItem.create!(create_options)
- ([activity.actor] + activity.actor.contacts).each{ |p| p.activity_items << activity }
+ if activity_type.to_s.eql?'new_message'
+ activity.subject.recipient.activity_items << activity
+ else
+ ([activity.actor] + activity.actor.contacts).each{ |p| p.activity_items << activity }
+ end
end
end
send(:"after_#{opts[:on]}", method_name, :if => opts[:if])
end