This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
def admin? | |
role == 'admin' | |
end | |
def marketer? | |
role == 'marketer' | |
end | |
def sales? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
attr_reader :role | |
def initialize(role) | |
@role = role | |
end | |
def admin? | |
role == 'admin' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
attr_reader :role | |
def initialize(role) | |
@role = role | |
end | |
def admin? | |
role == 'admin' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
attr_reader :role | |
def initialize(role) | |
@role = role | |
end | |
def admin? | |
role == 'admin' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer