assemblymade/coderwall

View on GitHub
app/jobs/assign_networks_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class AssignNetworksJob
  include Sidekiq::Worker

  sidekiq_options queue: :network

  def perform(username)
    user = User.find_by_username(username)
    user.skills.map(&:name).each do |skill|
      Network.all_with_tag(skill).each do |network|
        user.join(network)
      end
    end
  end
end