Sha256: 67a81644b546d61d0af2fefb69c15dc185b510d5cc57fb830fb4018d6af53c9a

Contents?: true

Size: 568 Bytes

Versions: 37

Compression:

Stored size: 568 Bytes

Contents

class UserEditProfileEventJob < EventJob
  attr_accessor :editor_id

  def initialize(editor_id)
    self.editor_id = editor_id
  end

  def run
    action = "User #{link_to_profile editor_id} has edited his or her profile"
    timestamp = Time.now.to_i
    editor = User.find_by_user_key(editor_id)
    # Create the event
    event = editor.create_event(action, timestamp)
    # Log the event to the editor's stream
    editor.log_event(event)
    # Fan out the event to all followers
    editor.followers.each do |user|
      user.log_event(event)
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
sufia-6.3.0 app/jobs/user_edit_profile_event_job.rb
sufia-6.2.0 app/jobs/user_edit_profile_event_job.rb
sufia-6.1.0 app/jobs/user_edit_profile_event_job.rb
sufia-5.0.0 app/jobs/user_edit_profile_event_job.rb
sufia-6.0.0 app/jobs/user_edit_profile_event_job.rb
sufia-6.0.0.rc4 app/jobs/user_edit_profile_event_job.rb
sufia-6.0.0.rc3 app/jobs/user_edit_profile_event_job.rb
sufia-5.0.0.rc1 app/jobs/user_edit_profile_event_job.rb
sufia-6.0.0.rc2 app/jobs/user_edit_profile_event_job.rb
sufia-6.0.0.rc1 app/jobs/user_edit_profile_event_job.rb
sufia-4.3.1 app/jobs/user_edit_profile_event_job.rb
sufia-6.0.0.beta1 app/jobs/user_edit_profile_event_job.rb
sufia-4.2.0 app/jobs/user_edit_profile_event_job.rb
sufia-4.1.0 app/jobs/user_edit_profile_event_job.rb
sufia-4.0.1 app/jobs/user_edit_profile_event_job.rb
sufia-4.0.0 app/jobs/user_edit_profile_event_job.rb
sufia-4.0.0.rc2 app/jobs/user_edit_profile_event_job.rb
sufia-4.0.0.rc1 app/jobs/user_edit_profile_event_job.rb
sufia-4.0.0.beta4 app/jobs/user_edit_profile_event_job.rb
sufia-4.0.0.beta3 app/jobs/user_edit_profile_event_job.rb