forked from bofh/fetsite
Kommentare hinzugefügt
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
# -*- coding: undecided -*-
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: moduls
|
# Table name: moduls
|
||||||
@@ -16,8 +17,8 @@ class Modul < ActiveRecord::Base
|
|||||||
has_and_belongs_to_many :lvas
|
has_and_belongs_to_many :lvas
|
||||||
has_and_belongs_to_many :modulgruppen
|
has_and_belongs_to_many :modulgruppen
|
||||||
|
|
||||||
validates :modulgruppen, :presence=>true
|
validates :modulgruppen, :presence=>true # Ein Modul muss zu einer Modulgruppe gehören
|
||||||
validates_presence_of :name
|
validates :name, :presence=>true # Ein Modul muss einen Namen haben
|
||||||
translates :desc,:depend,:name, :versioning =>true, :fallbacks_for_empty_translations => true
|
translates :desc,:depend,:name, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,10 +16,12 @@ class Modulgruppe < ActiveRecord::Base
|
|||||||
attr_accessible :name, :phase, :typ,:desc, :studium_id
|
attr_accessible :name, :phase, :typ,:desc, :studium_id
|
||||||
belongs_to :studium, :foreign_key => "studium_id"
|
belongs_to :studium, :foreign_key => "studium_id"
|
||||||
has_and_belongs_to_many :moduls
|
has_and_belongs_to_many :moduls
|
||||||
|
|
||||||
resourcify
|
resourcify
|
||||||
validates :studium_id, :presence => true
|
|
||||||
validates :studium, :presence => true
|
validates :studium_id, :presence => true # Bei der Abfrage ist student_id entscheidend
|
||||||
validates :name, :uniqueness =>{:scope => :studium}, :presence=>true
|
validates :studium, :presence => true # Wird gesetzt, um das richtige Feld zu melden bei Fehlern
|
||||||
|
validates :name, :uniqueness =>{:scope => :studium}, :presence=>true # Funktioniert leider nicht
|
||||||
validates :phase, :inclusion => {:in => [1, 2, 3, 4]}
|
validates :phase, :inclusion => {:in => [1, 2, 3, 4]}
|
||||||
validates :typ, :inclusion => {:in => ["Pflicht","Vertiefungspflicht","Wahl"] }
|
validates :typ, :inclusion => {:in => ["Pflicht","Vertiefungspflicht","Wahl"] }
|
||||||
translates :name,:desc, :versioning =>true,:fallbacks_for_empty_translations => true
|
translates :name,:desc, :versioning =>true,:fallbacks_for_empty_translations => true
|
||||||
|
|||||||
Reference in New Issue
Block a user