#851: destroy build_lists on removing repository

This commit is contained in:
Vokhmin Alexey V 2013-01-24 17:55:04 +04:00
parent e65a00e622
commit b818bac2ac
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,8 @@ class Repository < ActiveRecord::Base
has_many :projects, :through => :project_to_repositories
has_one :key_pair, :dependent => :destroy
has_many :build_lists, :foreign_key => :save_to_repository_id, :dependent => :destroy
validates :description, :presence => true
validates :name, :uniqueness => {:scope => :platform_id, :case_sensitive => false}, :presence => true, :format => {:with => /\A[a-z0-9_\-]+\z/}