BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9e2525cb
Commit
9e2525cb
authored
Mar 24, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Association form user to snippets added
parent
5b35000f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
user.rb
app/models/user.rb
+1
-0
user_spec.rb
spec/models/user_spec.rb
+1
-0
No files found.
app/models/user.rb
View file @
9e2525cb
...
...
@@ -75,6 +75,7 @@ class User < ActiveRecord::Base
has_many
:team_projects
,
through: :user_team_project_relationships
# Projects
has_many
:snippets
,
dependent: :destroy
,
foreign_key: :author_id
,
class_name:
"Snippet"
has_many
:users_projects
,
dependent: :destroy
has_many
:issues
,
dependent: :destroy
,
foreign_key: :author_id
has_many
:notes
,
dependent: :destroy
,
foreign_key: :author_id
...
...
spec/models/user_spec.rb
View file @
9e2525cb
...
...
@@ -40,6 +40,7 @@ require 'spec_helper'
describe
User
do
describe
"Associations"
do
it
{
should
have_one
(
:namespace
)
}
it
{
should
have_many
(
:snippets
).
class_name
(
'Snippet'
).
dependent
(
:destroy
)
}
it
{
should
have_many
(
:users_projects
).
dependent
(
:destroy
)
}
it
{
should
have_many
(
:groups
)
}
it
{
should
have_many
(
:keys
).
dependent
(
:destroy
)
}
...
...
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