Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
candi-date-tayo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
George Nicole Balmaceda
candi-date-tayo
Commits
fcc48073
Commit
fcc48073
authored
Jul 18, 2016
by
Alexander Hans Collado Jr.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added associations for models
parent
40b5c492
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
1 deletion
+34
-1
candidate.rb
app/models/candidate.rb
+1
-0
position.rb
app/models/position.rb
+3
-0
20160718135621_create_positions.rb
db/migrate/20160718135621_create_positions.rb
+9
-0
schema.rb
db/schema.rb
+7
-1
positions.yml
test/fixtures/positions.yml
+7
-0
position_test.rb
test/models/position_test.rb
+7
-0
No files found.
app/models/candidate.rb
View file @
fcc48073
class
Candidate
<
ApplicationRecord
class
Candidate
<
ApplicationRecord
belongs_to
:position
end
end
app/models/position.rb
0 → 100644
View file @
fcc48073
class
Position
<
ApplicationRecord
has_many
:candidates
end
db/migrate/20160718135621_create_positions.rb
0 → 100644
View file @
fcc48073
class
CreatePositions
<
ActiveRecord
::
Migration
[
5.0
]
def
change
create_table
:positions
do
|
t
|
t
.
string
:name
t
.
timestamps
end
end
end
db/schema.rb
View file @
fcc48073
...
@@ -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:
20160718135
122
)
do
ActiveRecord
::
Schema
.
define
(
version:
20160718135
621
)
do
create_table
"candidates"
,
force: :cascade
do
|
t
|
create_table
"candidates"
,
force: :cascade
do
|
t
|
t
.
string
"first_name"
t
.
string
"first_name"
...
@@ -22,6 +22,12 @@ ActiveRecord::Schema.define(version: 20160718135122) do
...
@@ -22,6 +22,12 @@ ActiveRecord::Schema.define(version: 20160718135122) do
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
create_table
"positions"
,
force: :cascade
do
|
t
|
t
.
string
"name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
create_table
"users"
,
force: :cascade
do
|
t
|
create_table
"users"
,
force: :cascade
do
|
t
|
t
.
string
"email"
,
default:
""
,
null:
false
t
.
string
"email"
,
default:
""
,
null:
false
t
.
string
"encrypted_password"
,
default:
""
,
null:
false
t
.
string
"encrypted_password"
,
default:
""
,
null:
false
...
...
test/fixtures/positions.yml
0 → 100644
View file @
fcc48073
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one
:
name
:
MyString
two
:
name
:
MyString
test/models/position_test.rb
0 → 100644
View file @
fcc48073
require
'test_helper'
class
PositionTest
<
ActiveSupport
::
TestCase
# test "the truth" do
# assert true
# end
end
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