Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EIP
Project Forum
Project Forum
Commits
b17ae494
Commit
b17ae494
authored
Aug 05, 2021
by
Taico Aerts
Browse files
Create company departments
parent
cf0f63d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/models/company.rb
View file @
b17ae494
...
...
@@ -9,6 +9,8 @@ class Company < ApplicationRecord
has_many
:role_invitations
,
as: :resource
,
dependent: :destroy
has_many
:company_departments
,
dependent: :destroy
enum
affiliation:
{
external:
0
,
internal:
1
}
# ===========================================================================
...
...
app/models/company_department.rb
0 → 100644
View file @
b17ae494
class
CompanyDepartment
<
ApplicationRecord
ROLES
=
[
:employee
].
freeze
resourcify
belongs_to
:company
end
\ No newline at end of file
db/migrate/20210521130324_create_company_departments.rb
0 → 100644
View file @
b17ae494
class
CreateCompanyDepartments
<
ActiveRecord
::
Migration
[
6.1
]
def
change
create_table
:company_departments
do
|
t
|
t
.
references
:company
,
null:
false
,
foreign_key:
true
t
.
string
:department
t
.
timestamps
end
end
end
\ No newline at end of file
db/schema.rb
View file @
b17ae494
...
...
@@ -104,6 +104,14 @@ ActiveRecord::Schema.define(version: 2021_07_20_205752) do
t
.
index
[
"original_id"
],
name:
"index_companies_on_original_id"
,
unique:
true
end
create_table
"company_departments"
,
force: :cascade
do
|
t
|
t
.
integer
"company_id"
,
null:
false
t
.
string
"department"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"company_id"
],
name:
"index_company_departments_on_company_id"
end
create_table
"course_configurations"
,
force: :cascade
do
|
t
|
t
.
integer
"min_group_size"
,
default:
1
,
null:
false
t
.
integer
"max_group_size"
,
default:
1
,
null:
false
...
...
@@ -703,6 +711,7 @@ ActiveRecord::Schema.define(version: 2021_07_20_205752) do
add_foreign_key
"active_storage_attachments"
,
"active_storage_blobs"
,
column:
"blob_id"
add_foreign_key
"active_storage_variant_records"
,
"active_storage_blobs"
,
column:
"blob_id"
add_foreign_key
"company_departments"
,
"companies"
add_foreign_key
"theme_associated_users"
,
"themes"
add_foreign_key
"theme_associated_users"
,
"users"
add_foreign_key
"thesis_project_associated_users"
,
"thesis_projects"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment