Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ group :development, :test do
gem 'rspec-rails'
gem 'rails-controller-testing'
gem "factory_bot_rails", "~> 4.0"
gem 'faker'
gem 'faker', :git => 'https://github.com/stympy/faker.git', :branch => 'master'
end

group :development do
Expand Down
12 changes: 9 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/stympy/faker.git
revision: c972b0d791dd99d45058ba4fe625dbd27bb3fbe0
branch: master
specs:
faker (1.8.4)
i18n (~> 0.5)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -52,8 +60,6 @@ GEM
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
faker (1.8.4)
i18n (~> 0.5)
ffi (1.9.18)
globalid (0.4.1)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -178,7 +184,7 @@ PLATFORMS
DEPENDENCIES
byebug
factory_bot_rails (~> 4.0)
faker
faker!
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
pg (~> 0.18)
Expand Down
5 changes: 5 additions & 0 deletions app/models/company.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Company < ApplicationRecord
has_many :interviews
has_many :interviewees, through: :interviews, source: :user
has_and_belongs_to_many :skills
end
5 changes: 5 additions & 0 deletions app/models/interview.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Interview < ApplicationRecord
has_and_belongs_to_many :skills
belongs_to :company
belongs_to :interviewee, foreign_key: 'user_id', class_name: 'User'
end
5 changes: 5 additions & 0 deletions app/models/skill.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Skill < ApplicationRecord
has_and_belongs_to_many :companies
has_and_belongs_to_many :users
has_and_belongs_to_many :interviews
end
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class User < ApplicationRecord
has_and_belongs_to_many :skills
has_many :interviews
end
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
scope :api do

end
end
19 changes: 19 additions & 0 deletions db/migrate/20171204005855_create_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :name
t.integer :year
t.string :cohort
t.string :location
t.string :email
t.string :linkedin_url
t.string :github_url
t.string :facebook_url
t.string :current_company
t.string :current_position
t.string :photo_url

t.timestamps
end
end
end
9 changes: 9 additions & 0 deletions db/migrate/20171204005931_create_skills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CreateSkills < ActiveRecord::Migration[5.1]
def change
create_table :skills do |t|
t.string :name

t.timestamps
end
end
end
8 changes: 8 additions & 0 deletions db/migrate/20171204010108_create_skills_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreateSkillsUsers < ActiveRecord::Migration[5.1]
def change
create_table :skills_users do |t|
t.references :user
t.references :skill
end
end
end
13 changes: 13 additions & 0 deletions db/migrate/20171204010457_create_companies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateCompanies < ActiveRecord::Migration[5.1]
def change
create_table :companies do |t|
t.string :name
t.string :location
t.string :website
t.string :tech_field
t.boolean :has_apprenticeship?

t.timestamps
end
end
end
8 changes: 8 additions & 0 deletions db/migrate/20171204010615_create_companies_skills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreateCompaniesSkills < ActiveRecord::Migration[5.1]
def change
create_table :companies_skills do |t|
t.references :company
t.references :skill
end
end
end
28 changes: 28 additions & 0 deletions db/migrate/20171204013338_create_interviews.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class CreateInterviews < ActiveRecord::Migration[5.1]
def change
create_table :interviews do |t|
t.string :job_title
t.boolean :referred?
t.boolean :received_offer?
t.text :notes
t.integer :difficulty_rating
t.integer :experience_rating
t.boolean :accepted_offer?
t.boolean :phone_screen?
t.text :phone_screen_details
t.boolean :tech_screen?
t.text :tech_screen_details
t.boolean :take_home_challenge?
t.text :take_home_challenge_details
t.boolean :onsite?
t.text :onsite_details
t.boolean :whiteboarding?
t.text :whiteboarding_details
t.text :negotiation_details
t.references :user
t.references :company

t.timestamps
end
end
end
8 changes: 8 additions & 0 deletions db/migrate/20171204013541_create_interviews_skills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreateInterviewsSkills < ActiveRecord::Migration[5.1]
def change
create_table :interviews_skills do |t|
t.references :skill
t.references :interview
end
end
end
98 changes: 98 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20171204013541) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "companies", force: :cascade do |t|
t.string "name"
t.string "location"
t.string "website"
t.string "tech_field"
t.boolean "has_apprenticeship?"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "companies_skills", force: :cascade do |t|
t.bigint "company_id"
t.bigint "skill_id"
t.index ["company_id"], name: "index_companies_skills_on_company_id"
t.index ["skill_id"], name: "index_companies_skills_on_skill_id"
end

create_table "interviews", force: :cascade do |t|
t.string "job_title"
t.boolean "referred?"
t.boolean "received_offer?"
t.text "notes"
t.integer "difficulty_rating"
t.integer "experience_rating"
t.boolean "accepted_offer?"
t.boolean "phone_screen?"
t.text "phone_screen_details"
t.boolean "tech_screen?"
t.text "tech_screen_details"
t.boolean "take_home_challenge?"
t.text "take_home_challenge_details"
t.boolean "onsite?"
t.text "onsite_details"
t.boolean "whiteboarding?"
t.text "whiteboarding_details"
t.text "negotiation_details"
t.bigint "user_id"
t.bigint "company_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["company_id"], name: "index_interviews_on_company_id"
t.index ["user_id"], name: "index_interviews_on_user_id"
end

create_table "interviews_skills", force: :cascade do |t|
t.bigint "skill_id"
t.bigint "interview_id"
t.index ["interview_id"], name: "index_interviews_skills_on_interview_id"
t.index ["skill_id"], name: "index_interviews_skills_on_skill_id"
end

create_table "skills", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "skills_users", force: :cascade do |t|
t.bigint "user_id"
t.bigint "skill_id"
t.index ["skill_id"], name: "index_skills_users_on_skill_id"
t.index ["user_id"], name: "index_skills_users_on_user_id"
end

create_table "users", force: :cascade do |t|
t.string "name"
t.integer "year"
t.string "cohort"
t.string "location"
t.string "email"
t.string "linkedin_url"
t.string "github_url"
t.string "facebook_url"
t.string "current_company"
t.string "current_position"
t.string "photo_url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end
Binary file added public/default_profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions spec/factories/companies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FactoryBot.define do
factory :company do
name { Faker::Company.name }
location { "#{Faker::Address.city}, #{Faker::Address.state}" }
website { Faker::Internet.url }
tech_field { Faker::Company.catch_phrase }
has_apprenticeship? { [true, false].sample }
association :interview
association :interviewees, factory: :user
end
end
22 changes: 22 additions & 0 deletions spec/factories/interviews.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FactoryBot.define do
factory :interview do
job_title "MyString"
referred? { [true, false].sample }
received_offer? false
notes "MyText"
difficulty_rating { (1..3).to_a.sample }
experience_rating { (1..3).to_a.sample }
accepted_offer? { [true, false].sample }
phone_screen? { [true, false].sample }
phone_screen_details { Faker::Hacker.say_something_smart }
tech_screen? { [true, false].sample }
tech_screen_details { Faker::Hacker.say_something_smart }
take_home_challenge? { [true, false].sample }
take_home_challenge_details { Faker::Hacker.say_something_smart }
onsite? { [true, false].sample }
onsite_details { Faker::Hacker.say_something_smart }
whiteboarding? { [true, false].sample }
whiteboarding_details { Faker::Hacker.say_something_smart }
negotiation_details { Faker::Hacker.say_something_smart }
end
end
5 changes: 5 additions & 0 deletions spec/factories/skills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FactoryBot.define do
factory :skill do
name { Faker::Company.catch_phrase }
end
end
19 changes: 19 additions & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'faker'

COHORTS = ['Bumblebees', 'Fiddler Crabs', 'Rock Doves', 'Fiery Skippers', 'Golden Bears', 'Red Pandas', 'Nighthawks', 'Pocket Gophers', 'Sea Lions', 'Fireflies', 'Foxes', 'Wild Pigs', 'Chorus Frogs', 'Squirrels', 'Otters', 'Jackrabbits', 'Bobolinks', 'Coyotes', 'Chipmunks', 'Salamanders', 'Wolves', 'Copperheads', 'Dragonflies', 'Purple Martins', 'Mud Turtles', 'Cicadas', 'Grasshoppers', 'Island Foxes', 'Grey Racoons', 'Desert Rabbits', 'Brown Bats', 'Largemouth Basses', 'Pocket Mice', 'Mule Deer', 'Tiger Swallowtails', 'Gopher Snakes', 'Fence Lizards', 'Red Admirals', 'Banana Slugs', 'Fox Squirrels']

FactoryBot.define do
factory :user do
name { Faker::Name.name }
year { (2012..2017).to_a.sample }
cohort { COHORTS.sample }
location { "#{Faker::Address.city}, #{Faker::Address.state}" }
email { Faker::Internet.email }
linkedin_url { Faker::Internet.url('linkedin.com') }
github_url { Faker::Internet.url('github.com') }
facebook_url { Faker::Internet.url('facebook.com') }
current_company { Faker::Company.name }
current_position { Faker::Company.profession }
photo_url { Faker::Fillmurray.image }
end
end
5 changes: 5 additions & 0 deletions spec/models/company_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe Company, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/models/interview_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe Interview, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/models/skill_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe Skill, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe User, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end