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 |
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
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 | |
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
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
<div class="row mt-3"> | |
<div class="col-10"> | |
<table class="table dashboard-daily-table"> | |
<thead class="thead-light dashboard-daily-table-header"> | |
<tr> | |
<th width="18%" scope="col"><%= Date.today.strftime("%A") %></th> | |
<th width="64%" scope="col"></th> | |
<th width="18%" scope="col"></th> | |
</tr> | |
</thead> |
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 ProjectsController < ApplicationController | |
# student.project is the reference to associated AR Project model. | |
def users_projects | |
teams = Team.all | |
students = teams.map(&:students).flatten | |
@student_projects = students.select do |student| | |
student.project.status == "Active" | |
end | |
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
departures: [ | |
{ | |
availability: 2 | |
discounted: false | |
start_date: 06-04-2013 | |
pricing: [ | |
{ | |
age_group: "Adult", | |
prices: [ | |
{name: "USD", value: 1000}, |
NewerOlder