Sha256: 3be066b572f6b620629761bdabc163835e6324d56ef57bc714d8375f6b4b3806
Contents?: true
Size: 735 Bytes
Versions: 37
Compression:
Stored size: 735 Bytes
Contents
class UserFollowEventJob < EventJob attr_accessor :follower_id, :followee_id def initialize(follower_id, followee_id) self.follower_id = follower_id self.followee_id = followee_id end def run # Create the event follower = User.find_by_user_key(follower_id) event = follower.create_event("User #{link_to_profile follower_id} is now following #{link_to_profile followee_id}", Time.now.to_i) # Log the event to the follower's stream follower.log_event(event) # Fan out the event to followee followee = User.find_by_user_key(followee_id) followee.log_event(event) # Fan out the event to all followers follower.followers.each do |user| user.log_event(event) end end end
Version data entries
37 entries across 37 versions & 1 rubygems