Skip to content

Instantly share code, notes, and snippets.

View Keqi's full-sized avatar

Maciej Nowak Keqi

View GitHub Profile
class User
def admin?
role == 'admin'
end
def marketer?
role == 'marketer'
end
def sales?
require 'httparty'
class UsersWorker
include Sidekiq::Worker
HOSTNAME = 'https://interview-api-app.herokuapp.com/users'
def perform(options={})
page_size = options[:page_size] || 10
page = options[:page] || 1
class User
attr_reader :role
def initialize(role)
@role = role
end
def admin?
role == 'admin'
end
class User
attr_reader :role
def initialize(role)
@role = role
end
def admin?
role == 'admin'
end
class User
attr_reader :role
def initialize(role)
@role = role
end
def admin?
role == 'admin'
end
airtable_cohorts = Airtable::ProgramStructureApi.new.cohorts
ProgramCohort.find_each do |pc|
r = airtable_cohorts.find { |record| record.fields['Cohort Name'] == pc.name }
next unless r
pc.update(external_id: r.id) if pc.external_id != r.id
end