Commit a701d6e3 by nnnghia98

update registration branch

parent c70440f0
...@@ -29,3 +29,7 @@ ...@@ -29,3 +29,7 @@
/yarn-error.log /yarn-error.log
yarn-debug.log* yarn-debug.log*
.yarn-integrity .yarn-integrity
config/settings.local.yml
config/settings/*.local.yml
config/environments/*.local.yml
...@@ -25,7 +25,7 @@ gem 'sunspot_rails' ...@@ -25,7 +25,7 @@ gem 'sunspot_rails'
gem 'sunspot_solr' gem 'sunspot_solr'
gem 'devise' gem 'devise'
gem 'activerecord-import' gem 'activerecord-import'
gem 'pry' gem 'config'
# Use Redis adapter to run Action Cable in production # Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0' # gem 'redis', '~> 4.0'
# Use Active Model has_secure_password # Use Active Model has_secure_password
...@@ -40,6 +40,8 @@ gem 'bootsnap', '>= 1.4.2', require: false ...@@ -40,6 +40,8 @@ gem 'bootsnap', '>= 1.4.2', require: false
group :development, :test do group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'pry'
gem 'annotate'
end end
group :development do group :development do
......
...@@ -60,6 +60,9 @@ GEM ...@@ -60,6 +60,9 @@ GEM
zeitwerk (~> 2.2) zeitwerk (~> 2.2)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
annotate (3.0.3)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
bcrypt (3.1.13) bcrypt (3.1.13)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.4.5) bootsnap (1.4.5)
...@@ -84,13 +87,48 @@ GEM ...@@ -84,13 +87,48 @@ GEM
childprocess (3.0.0) childprocess (3.0.0)
coderay (1.1.2) coderay (1.1.2)
concurrent-ruby (1.1.5) concurrent-ruby (1.1.5)
config (2.0.0)
activesupport (>= 4.2)
deep_merge (~> 1.2, >= 1.2.1)
dry-schema (~> 1.0)
crass (1.0.5) crass (1.0.5)
deep_merge (1.2.1)
devise (4.7.1) devise (4.7.1)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (>= 4.1.0) railties (>= 4.1.0)
responders responders
warden (~> 1.2.3) warden (~> 1.2.3)
dry-configurable (0.9.0)
concurrent-ruby (~> 1.0)
dry-core (~> 0.4, >= 0.4.7)
dry-container (0.7.2)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1, >= 0.1.3)
dry-core (0.4.9)
concurrent-ruby (~> 1.0)
dry-equalizer (0.3.0)
dry-inflector (0.2.0)
dry-initializer (3.0.2)
dry-logic (1.0.5)
concurrent-ruby (~> 1.0)
dry-core (~> 0.2)
dry-equalizer (~> 0.2)
dry-schema (1.4.1)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.8, >= 0.8.3)
dry-core (~> 0.4)
dry-equalizer (~> 0.2)
dry-initializer (~> 3.0)
dry-logic (~> 1.0)
dry-types (~> 1.2)
dry-types (1.2.1)
concurrent-ruby (~> 1.0)
dry-container (~> 0.3)
dry-core (~> 0.4, >= 0.4.4)
dry-equalizer (~> 0.2, >= 0.2.2)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 1.0, >= 1.0.2)
erubi (1.9.0) erubi (1.9.0)
faraday (0.17.1) faraday (0.17.1)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
...@@ -263,10 +301,12 @@ PLATFORMS ...@@ -263,10 +301,12 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
activerecord-import activerecord-import
annotate
bootsnap (>= 1.4.2) bootsnap (>= 1.4.2)
byebug byebug
capybara (>= 2.15) capybara (>= 2.15)
carrierwave carrierwave
config
devise devise
jbuilder jbuilder
jquery-rails (= 4.3.1) jquery-rails (= 4.3.1)
......
...@@ -14,7 +14,7 @@ $light-gray: #777; ...@@ -14,7 +14,7 @@ $light-gray: #777;
/* universal */ /* universal */
body { body {
padding-top: 90px; padding-top: 60px;
} }
section { section {
......
...@@ -2,6 +2,6 @@ class StaticPagesController < ApplicationController ...@@ -2,6 +2,6 @@ class StaticPagesController < ApplicationController
def index def index
@cities = City.all @cities = City.all
@industries = Industry.all @industries = Industry.all
@jobs = Job.page(params[:page]).per(5) @jobs = Job.page(params[:page]).per(Settings.jobs.page.per)
end end
end end
# In database # == Schema Information
# t.string :name, unique: true #
# t.string :region # Table name: cities
#
# id :bigint not null, primary key
# name :string(255)
# region :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_cities_on_name (name) UNIQUE
#
class City < ApplicationRecord class City < ApplicationRecord
end end
# == Schema Information
#
# Table name: city_jobs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# city_id :bigint
# job_id :bigint
#
# Indexes
#
# index_city_jobs_on_city_id (city_id)
# index_city_jobs_on_job_id (job_id)
#
# Foreign Keys
#
# fk_rails_... (city_id => cities.id)
# fk_rails_... (job_id => jobs.id)
#
class CityJob < ApplicationRecord class CityJob < ApplicationRecord
belongs_to :city belongs_to :city
belongs_to :job belongs_to :job
......
# In db # == Schema Information
# t.string :name #
# t.string :email, unique: true # Table name: companies
# t.text :description #
# t.string :address # id :bigint not null, primary key
# address :string(255)
# add_index :industries, :name, unique: true # code :string(255)
# description :text(65535)
# email :string(255)
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_companies_on_code (code) UNIQUE
# index_companies_on_email (email) UNIQUE
#
class Company < ApplicationRecord class Company < ApplicationRecord
has_many :jobs, dependent: :destroy has_many :jobs, dependent: :destroy
......
# == Schema Information
#
# Table name: crawl_urls
#
# id :bigint not null, primary key
# crawled :boolean default(FALSE)
# title :string(255)
# url :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class CrawlUrl < ApplicationRecord class CrawlUrl < ApplicationRecord
end end
# In db # == Schema Information
# t.string :name #
# Table name: industries
#
# id :bigint not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_industries_on_name (name) UNIQUE
#
class Industry < ApplicationRecord class Industry < ApplicationRecord
end end
# == Schema Information
#
# Table name: industry_jobs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# industry_id :bigint
# job_id :bigint
#
# Indexes
#
# index_industry_jobs_on_industry_id (industry_id)
# index_industry_jobs_on_job_id (job_id)
#
# Foreign Keys
#
# fk_rails_... (industry_id => industries.id)
# fk_rails_... (job_id => jobs.id)
#
class IndustryJob < ApplicationRecord class IndustryJob < ApplicationRecord
belongs_to :industry belongs_to :industry
belongs_to :job belongs_to :job
......
# In database # == Schema Information
# t.string :title #
# t.string :level # Table name: jobs
# t.string :salary #
# t.string :other_salary # id :bigint not null, primary key
# t.text :description # category :integer
# t.text :short_des # code :string(255)
# t.text :requirement # description :text(65535)
# t.integer :category # expiration_date :datetime
# t.datetime :post_date # level :string(255)
# t.datetime :expiration_date # other_salary :string(255)
# t.references :company, null: false, foreign_key: true # post_date :datetime
# requirement :text(65535)
# salary :string(255)
# short_des :text(65535)
# title :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# company_id :bigint
#
# Indexes
#
# index_jobs_on_code (code) UNIQUE
# index_jobs_on_company_id (company_id)
#
# Foreign Keys
#
# fk_rails_... (company_id => companies.id)
#
class Job < ApplicationRecord class Job < ApplicationRecord
belongs_to :company belongs_to :company
......
# == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# activated :boolean
# confirmation_token :string(255)
# confirmed_at :datetime
# cv_path :string(255)
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# first_name :string(255)
# last_name :string(255)
# remember_created_at :datetime
# remember_digest :string(255)
# reset_password_sent_at :datetime
# reset_password_token :string(255)
# role :integer
# username :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_users_on_email (email) UNIQUE
# index_users_on_reset_password_token (reset_password_token) UNIQUE
# index_users_on_username (username) UNIQUE
#
class User < ApplicationRecord class User < ApplicationRecord
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
......
# == Schema Information
#
# Table name: user_jobs
#
# id :bigint not null, primary key
# applied_at :datetime
# favorited_at :datetime
# viewed_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# job_id :bigint
# user_id :bigint
#
# Indexes
#
# index_user_jobs_on_job_id (job_id)
# index_user_jobs_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (job_id => jobs.id)
# fk_rails_... (user_id => users.id)
#
class UserJob < ApplicationRecord class UserJob < ApplicationRecord
belongs_to :user belongs_to :user
belongs_to :job belongs_to :job
......
require "csv"
require "activerecord-import"
# require "activerecord -import/active_record/adapters/mysql_adapter"
class CityImport
def cities
cities = []
columns = [:name, :region]
CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
cities << {name: row["company province"], region: "Việt Nam"}
end
City.import columns, cities, on_duplicate_key_ignore: true
end
end
\ No newline at end of file
require "csv"
require "activerecord-import"
# require "activerecord -import/active_record/adapters/mysql_adapter"
class CompanyImport
def companies
companies = []
columns = [:name, :email, :address, :company_code]
CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
companies << {name: row["company name"], email: row["contact email"],
address: row["company address"], company_code: row["company id"]}
end
Company.import columns, companies, on_duplicate_key_ignore: true
end
end
\ No newline at end of file
require "csv"
class Import
def import
cities = []
companies = []
industries = []
city_columns = [:name, :region]
company_columns = [:name, :email, :address, :code]
industry_columns = [:name]
CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
cities << {name: row["company province"], region: "Việt Nam"}
companies << {name: row["company name"], email: row["contact email"],
address: row["company address"], code: row["company id"]}
industries << {name: row["category"]}
end
City.import city_columns, cities, on_duplicate_key_ignore: true
puts "Cities imported"
Company.import company_columns, companies, on_duplicate_key_ignore: true
puts "Companies imported"
Industry.import industry_columns, industries, on_duplicate_key_ignore: true
puts "Industries imported"
end
end
require "csv"
require "activerecord-import"
# require "activerecord -import/active_record/adapters/mysql_adapter"
class IndustryImport
def industries
industries = []
columns = [:name]
CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
industries << {name: row["category"]}
end
Industry.import columns, industries, on_duplicate_key_ignore: true
end
end
class JobCsv
def initialize(row)
@row = row
end
def title
@title ||= @row["name"]
end
def level
@level ||= @row["level"]
end
def salary
@salary ||= @row["salary"]
end
def description
@description ||= @row["description"]
end
def short_des
@short_des ||= @row["benefit"]
end
def requirement
@requirement ||= @row["requirement"]
end
def category
@category ||= @row["type"]
end
def company_id
@company_id ||= company.id
end
def company
@company ||= Company.find_by(code: @row["company id"]) ||
Company.create(name: @row["company name"], email: @row["contact email"],
address: @row["company address"],
code: @row["company id"])
end
def csv_attributes
{title: title, level: level, salary: salary, description: description,
short_des: short_des, requirement: requirement, category: category,
company_id: company_id}
end
end
require "csv"
require "activerecord-import"
# require "activerecord -import/active_record/adapters/mysql_adapter"
class JobImport
def jobs
jobs = []
columns = [:title, :level, :salary, :description, :short_des, :requirement,
:category, :company_id]
CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
jobs << {title: row["name"], level: row["level"], salary: row["salary"],
description: row["description"], short_des: row["benefit"],
requirement: row["requirement"], category: row["type"],
company_id: Company.find_by(company_code: row["company id"])&.id}
end
Job.import columns, jobs
end
end
\ No newline at end of file
require "csv"
class JobsImport
def import_job
jobs = []
job_columns = [:title, :level, :salary, :description, :short_des,
:requirement, :category, :company_id]
CSV.foreach(Rails.root.join("lib", "jobss.csv"), headers: true) do |row|
jobs << JobCsv.new(row).csv_attributes
end
Job.import job_columns, jobs
puts "Jobs imported"
end
end
<table class="table"> <%= render partial: "cities/city", collection: @cities %>
<thead>
<tr>
<th scope="col">name</th>
<th scope="col">region</th>
</tr>
</thead>
<tbody>
<% @cities.each do |city| %>
<tr>
<td><%= city.name %></td>
<td><%= city.region %></td>
</tr>
<% end %>
</tbody>
</table>
<tr>
<td><%= company.name %></td>
<td><%= company.email %></td>
<td><%= company.address %></td>
</tr>
<table class="table"> <table class="table">
<thead>
<tr>
<th scope="col">company name</th>
<th scope="col">contact email</th>
<th scope="col">company address</th>
<th scope="col">company code</th>
</tr>
</thead>
<tbody> <tbody>
<% @companies.each do |company| %> <ul class="table">
<tr> <%= render partial: "companies/company", collection: @companies %>
<td><%= company.name %></td> </ul>
<td><%= company.email %></td>
<td><%= company.address %></td>
<td><%= company.company_code %></td>
</tr>
<% end %>
</tbody> </tbody>
</table> </table>
<table class="table"> <%= render partial: "industries/industry", collection: @industries %>
<thead>
<tr>
<th scope="col">name</th>
</tr>
</thead>
<tbody>
<% @industries.each do |industry| %>
<tr>
<td><%= industry.name %></td>
</tr>
<% end %>
</tbody>
</table>
<table class="table"> <%= render partial: "jobs/job", collection: @jobs %>
<thead>
<tr>
<th scope="col">title</th>
<th scope="col">short description</th>
<th scope="col">salary</th>
</tr>
</thead>
<tbody>
<% @jobs.each do |job| %>
<tr>
<td><%= job.title %></td>
<td><%= job.short_des %></td>
<td><%= job.salary %></td>
</tr>
<% end %>
</tbody>
</table>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<p class="notice"><%= notice %></p> <p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p> <p class="alert"><%= alert %></p>
</div> </div>
<%= render "layouts/header" %> <%= render "layouts/header" %>
<div class="container"> <div class="container">
<%= yield %> <%= yield %>
<%= render "layouts/footer" %> <%= render "layouts/footer" %>
......
Config.setup do |config|
# Name of the constant exposing loaded settings
config.const_name = 'Settings'
# Ability to remove elements of the array set in earlier loaded settings file. For example value: '--'.
#
# config.knockout_prefix = nil
# Overwrite an existing value when merging a `nil` value.
# When set to `false`, the existing value is retained after merge.
#
# config.merge_nil_values = true
# Overwrite arrays found in previously loaded settings file. When set to `false`, arrays will be merged.
#
# config.overwrite_arrays = true
# Load environment variables from the `ENV` object and override any settings defined in files.
#
# config.use_env = false
# Define ENV variable prefix deciding which variables to load into config.
#
# config.env_prefix = 'Settings'
# What string to use as level separator for settings loaded from ENV variables. Default value of '.' works well
# with Heroku, but you might want to change it for example for '__' to easy override settings from command line, where
# using dots in variable names might not be allowed (eg. Bash).
#
# config.env_separator = '.'
# Ability to process variables names:
# * nil - no change
# * :downcase - convert to lower case
#
# config.env_converter = :downcase
# Parse numeric values as integers instead of strings.
#
# config.env_parse_values = true
# Validate presence and type of specific config values. Check https://github.com/dry-rb/dry-validation for details.
#
# config.schema do
# required(:name).filled
# required(:age).maybe(:int?)
# required(:email).filled(format?: EMAIL_REGEX)
# end
end
Rails.application.routes.draw do Rails.application.routes.draw do
get "companies/index" resources :companies, only: :index
resources :companies do resources :industries, only: :index
collection {post :import} resources :cities, only: :index
end resources :jobs, only: :index
get "industries/index"
resources :industries do
collection {post :import}
end
get "cities/index"
resources :cities do
collection {post :import}
end
get "jobs/index"
resources :jobs do
collection {post :import}
end
devise_for :users devise_for :users
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root "static_pages#index" root "static_pages#index"
get "static_pages/index" get "static_pages/index"
end end
jobs:
page:
per: 5
class AddCompanyCodeToCompany < ActiveRecord::Migration[6.0] class AddCompanyCodeToCompany < ActiveRecord::Migration[6.0]
def change def change
add_column :companies, :company_code, :string, unique: true add_column :companies, :code, :string, unique: true
add_index :companies, :code, unique: true
end end
end end
class AddIndexToCompanyCode < ActiveRecord::Migration[6.0] class AddCodeToJob < ActiveRecord::Migration[6.0]
def change def change
add_index :companies, :company_code, unique: true add_column :jobs, :code, :string, unique: true
add_index :jobs, :code, unique: true
end end
end end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_12_02_023440) do ActiveRecord::Schema.define(version: 2019_12_05_090113) do
create_table "cities", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| create_table "cities", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "name" t.string "name"
...@@ -36,8 +36,8 @@ ActiveRecord::Schema.define(version: 2019_12_02_023440) do ...@@ -36,8 +36,8 @@ ActiveRecord::Schema.define(version: 2019_12_02_023440) do
t.string "address" t.string "address"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
t.string "company_code" t.string "code"
t.index ["company_code"], name: "index_companies_on_company_code", unique: true t.index ["code"], name: "index_companies_on_code", unique: true
t.index ["email"], name: "index_companies_on_email", unique: true t.index ["email"], name: "index_companies_on_email", unique: true
end end
...@@ -79,6 +79,8 @@ ActiveRecord::Schema.define(version: 2019_12_02_023440) do ...@@ -79,6 +79,8 @@ ActiveRecord::Schema.define(version: 2019_12_02_023440) do
t.bigint "company_id" t.bigint "company_id"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
t.string "code"
t.index ["code"], name: "index_jobs_on_code", unique: true
t.index ["company_id"], name: "index_jobs_on_company_id" t.index ["company_id"], name: "index_jobs_on_company_id"
end end
......
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if Rails.env.development?
require 'annotate'
task :set_annotation_options do
# You can override any of these by setting an environment variable of the
# same name.
Annotate.set_defaults(
'additional_file_patterns' => [],
'routes' => 'false',
'models' => 'true',
'position_in_routes' => 'before',
'position_in_class' => 'before',
'position_in_test' => 'before',
'position_in_fixture' => 'before',
'position_in_factory' => 'before',
'position_in_serializer' => 'before',
'show_foreign_keys' => 'true',
'show_complete_foreign_keys' => 'false',
'show_indexes' => 'true',
'simple_indexes' => 'false',
'model_dir' => 'app/models',
'root_dir' => '',
'include_version' => 'false',
'require' => '',
'exclude_tests' => 'false',
'exclude_fixtures' => 'false',
'exclude_factories' => 'false',
'exclude_serializers' => 'false',
'exclude_scaffolds' => 'true',
'exclude_controllers' => 'true',
'exclude_helpers' => 'true',
'exclude_sti_subclasses' => 'false',
'ignore_model_sub_dir' => 'false',
'ignore_columns' => nil,
'ignore_routes' => nil,
'ignore_unknown_models' => 'false',
'hide_limit_column_types' => 'integer,bigint,boolean',
'hide_default_column_types' => 'json,jsonb,hstore',
'skip_on_db_migrate' => 'false',
'format_bare' => 'true',
'format_rdoc' => 'false',
'format_markdown' => 'false',
'sort' => 'false',
'force' => 'false',
'frozen' => 'false',
'classified_sort' => 'true',
'trace' => 'false',
'wrapper_open' => nil,
'wrapper_close' => nil,
'with_comment' => 'true'
)
end
Annotate.load_tasks
end
require "./app/services/cities.rb"
require "./app/services/industries.rb"
require "./app/services/companies.rb"
require "./app/services/jobs.rb"
namespace :task do namespace :task do
desc "import data" desc "import data"
task import: :environment do task import: :environment do
CityImport.new.cities Import.new.import
CompanyImport.new.companies JobsImport.new.import_job
IndustryImport.new.industries
JobImport.new.jobs
end end
end end
...@@ -6,7 +6,7 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest ...@@ -6,7 +6,7 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
end end
test "should get top_page" do test "should get top_page" do
get static_pages_index_url get root_path
assert_response :success assert_response :success
assert_select "title", "Top Page | #{@base_title}" assert_select "title", "Top Page | #{@base_title}"
end end
......
# == Schema Information
#
# Table name: cities
#
# id :bigint not null, primary key
# name :string(255)
# region :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_cities_on_name (name) UNIQUE
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: city_jobs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# city_id :bigint
# job_id :bigint
#
# Indexes
#
# index_city_jobs_on_city_id (city_id)
# index_city_jobs_on_job_id (job_id)
#
# Foreign Keys
#
# fk_rails_... (city_id => cities.id)
# fk_rails_... (job_id => jobs.id)
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: companies
#
# id :bigint not null, primary key
# address :string(255)
# code :string(255)
# description :text(65535)
# email :string(255)
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_companies_on_code (code) UNIQUE
# index_companies_on_email (email) UNIQUE
#
# == Schema Information
#
# Table name: crawl_urls
#
# id :bigint not null, primary key
# crawled :boolean default(FALSE)
# title :string(255)
# url :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: industries
#
# id :bigint not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_industries_on_name (name) UNIQUE
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: industry_jobs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# industry_id :bigint
# job_id :bigint
#
# Indexes
#
# index_industry_jobs_on_industry_id (industry_id)
# index_industry_jobs_on_job_id (job_id)
#
# Foreign Keys
#
# fk_rails_... (industry_id => industries.id)
# fk_rails_... (job_id => jobs.id)
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: jobs
#
# id :bigint not null, primary key
# category :integer
# code :string(255)
# description :text(65535)
# expiration_date :datetime
# level :string(255)
# other_salary :string(255)
# post_date :datetime
# requirement :text(65535)
# salary :string(255)
# short_des :text(65535)
# title :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# company_id :bigint
#
# Indexes
#
# index_jobs_on_code (code) UNIQUE
# index_jobs_on_company_id (company_id)
#
# Foreign Keys
#
# fk_rails_... (company_id => companies.id)
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: user_jobs
#
# id :bigint not null, primary key
# applied_at :datetime
# favorited_at :datetime
# viewed_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# job_id :bigint
# user_id :bigint
#
# Indexes
#
# index_user_jobs_on_job_id (job_id)
# index_user_jobs_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (job_id => jobs.id)
# fk_rails_... (user_id => users.id)
#
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# activated :boolean
# confirmation_token :string(255)
# confirmed_at :datetime
# cv_path :string(255)
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# first_name :string(255)
# last_name :string(255)
# remember_created_at :datetime
# remember_digest :string(255)
# reset_password_sent_at :datetime
# reset_password_token :string(255)
# role :integer
# username :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_users_on_email (email) UNIQUE
# index_users_on_reset_password_token (reset_password_token) UNIQUE
# index_users_on_username (username) UNIQUE
#
# == Schema Information
#
# Table name: city_jobs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# city_id :bigint
# job_id :bigint
#
# Indexes
#
# index_city_jobs_on_city_id (city_id)
# index_city_jobs_on_job_id (job_id)
#
# Foreign Keys
#
# fk_rails_... (city_id => cities.id)
# fk_rails_... (job_id => jobs.id)
#
require 'test_helper' require 'test_helper'
class CityJobTest < ActiveSupport::TestCase class CityJobTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: cities
#
# id :bigint not null, primary key
# name :string(255)
# region :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_cities_on_name (name) UNIQUE
#
require 'test_helper' require 'test_helper'
class CityTest < ActiveSupport::TestCase class CityTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: companies
#
# id :bigint not null, primary key
# address :string(255)
# code :string(255)
# description :text(65535)
# email :string(255)
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_companies_on_code (code) UNIQUE
# index_companies_on_email (email) UNIQUE
#
require 'test_helper' require 'test_helper'
class CompanyTest < ActiveSupport::TestCase class CompanyTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: crawl_urls
#
# id :bigint not null, primary key
# crawled :boolean default(FALSE)
# title :string(255)
# url :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
require 'test_helper' require 'test_helper'
class CrawlUrlTest < ActiveSupport::TestCase class CrawlUrlTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: industry_jobs
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# industry_id :bigint
# job_id :bigint
#
# Indexes
#
# index_industry_jobs_on_industry_id (industry_id)
# index_industry_jobs_on_job_id (job_id)
#
# Foreign Keys
#
# fk_rails_... (industry_id => industries.id)
# fk_rails_... (job_id => jobs.id)
#
require 'test_helper' require 'test_helper'
class IndustryJobTest < ActiveSupport::TestCase class IndustryJobTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: industries
#
# id :bigint not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_industries_on_name (name) UNIQUE
#
require 'test_helper' require 'test_helper'
class IndustryTest < ActiveSupport::TestCase class IndustryTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: jobs
#
# id :bigint not null, primary key
# category :integer
# code :string(255)
# description :text(65535)
# expiration_date :datetime
# level :string(255)
# other_salary :string(255)
# post_date :datetime
# requirement :text(65535)
# salary :string(255)
# short_des :text(65535)
# title :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# company_id :bigint
#
# Indexes
#
# index_jobs_on_code (code) UNIQUE
# index_jobs_on_company_id (company_id)
#
# Foreign Keys
#
# fk_rails_... (company_id => companies.id)
#
require 'test_helper' require 'test_helper'
class JobTest < ActiveSupport::TestCase class JobTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: user_jobs
#
# id :bigint not null, primary key
# applied_at :datetime
# favorited_at :datetime
# viewed_at :datetime
# created_at :datetime not null
# updated_at :datetime not null
# job_id :bigint
# user_id :bigint
#
# Indexes
#
# index_user_jobs_on_job_id (job_id)
# index_user_jobs_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (job_id => jobs.id)
# fk_rails_... (user_id => users.id)
#
require 'test_helper' require 'test_helper'
class UserJobTest < ActiveSupport::TestCase class UserJobTest < ActiveSupport::TestCase
......
# == Schema Information
#
# Table name: users
#
# id :bigint not null, primary key
# activated :boolean
# confirmation_token :string(255)
# confirmed_at :datetime
# cv_path :string(255)
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# first_name :string(255)
# last_name :string(255)
# remember_created_at :datetime
# remember_digest :string(255)
# reset_password_sent_at :datetime
# reset_password_token :string(255)
# role :integer
# username :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_users_on_email (email) UNIQUE
# index_users_on_reset_password_token (reset_password_token) UNIQUE
# index_users_on_username (username) UNIQUE
#
require 'test_helper' require 'test_helper'
class UserTest < ActiveSupport::TestCase class UserTest < ActiveSupport::TestCase
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment