#851: destroy build_lists on removing repository
This commit is contained in:
parent
e65a00e622
commit
b818bac2ac
|
@ -11,6 +11,8 @@ class Repository < ActiveRecord::Base
|
||||||
has_many :projects, :through => :project_to_repositories
|
has_many :projects, :through => :project_to_repositories
|
||||||
has_one :key_pair, :dependent => :destroy
|
has_one :key_pair, :dependent => :destroy
|
||||||
|
|
||||||
|
has_many :build_lists, :foreign_key => :save_to_repository_id, :dependent => :destroy
|
||||||
|
|
||||||
validates :description, :presence => true
|
validates :description, :presence => true
|
||||||
validates :name, :uniqueness => {:scope => :platform_id, :case_sensitive => false}, :presence => true, :format => {:with => /\A[a-z0-9_\-]+\z/}
|
validates :name, :uniqueness => {:scope => :platform_id, :case_sensitive => false}, :presence => true, :format => {:with => /\A[a-z0-9_\-]+\z/}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue