Semester "ohne zuordnung"

This commit is contained in:
Thomas Blazek
2013-07-29 18:42:44 +02:00
parent d9618d5bba
commit 5f45487d00
2 changed files with 18 additions and 9 deletions

View File

@@ -18,7 +18,6 @@ class Semester < ActiveRecord::Base
belongs_to :studium, :foreign_key => "studium_id"
validates :name, :presence => true
validates :nummer, :presence => true
validates :ssws, :presence => true
class << self
def batch_add(name, type, target)
if type == "Bachelor"
@@ -38,6 +37,12 @@ class Semester < ActiveRecord::Base
semester.save
target << semester
end
semester = Semester.new()
semester.name = "Ohne Zuordnung"
semester.nummer = 0
semester.ssws = "WS"
semester.save
target << semester
end
def batch_destroy(studium)