Skip to content
Snippets Groups Projects
Commit 9e2525cb authored by Andrew8xx8's avatar Andrew8xx8
Browse files

Association form user to snippets added

parent 5b35000f
No related branches found
No related tags found
1 merge request!3351Personal snipepts support added
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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) }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment