Introducing Semesters

This commit is contained in:
Thomas Blazek
2013-07-29 17:47:44 +02:00
parent 747ba5f91a
commit 161598846a
13 changed files with 151 additions and 47 deletions

View File

@@ -13,8 +13,9 @@
#
class Studium < ActiveRecord::Base
attr_accessible :desc, :name, :typ, :zahl
attr_accessible :desc, :name, :typ, :zahl, :semester
has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe"
has_many :semester, :dependent => :destroy
validates :typ, :inclusion => {:in => ["Bachelor","Master"] }
validates :name, :uniqueness => true, :presence=>true