Safeguards

This commit is contained in:
Thomas Blazek
2013-08-02 12:46:34 +02:00
parent 1c1b0cfe91
commit 58663f25f1
2 changed files with 22 additions and 10 deletions

View File

@@ -13,7 +13,7 @@
# updated_at :datetime not null
class Studium < ActiveRecord::Base
attr_accessible :desc, :name, :typ, :zahl
has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe"
has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe", :dependent => :destroy
has_many :semester, :dependent => :destroy
validates :typ, :inclusion => {:in => ["Bachelor","Master"] }