Validations korrigiert

Hab jetzt den Namen von Modulgruppen aus den Translations
herausgenommen, dadurch funktioniert uniqueness
This commit is contained in:
Thomas Blazek
2013-07-30 09:41:32 +02:00
parent f2b8e354fe
commit 3cc2899b26
2 changed files with 5 additions and 5 deletions

View File

@@ -21,8 +21,8 @@ class Modulgruppe < ActiveRecord::Base
validates :studium_id, :presence => true # Bei der Abfrage ist student_id entscheidend
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 :name, :uniqueness =>{:scope => :studium_id}, :presence=>true # Pro Studium darf ein Name nur einmal vorkommen
validates :phase, :inclusion => {:in => [1, 2, 3, 4]}
validates :typ, :inclusion => {:in => ["Pflicht","Vertiefungspflicht","Wahl"] }
translates :name,:desc, :versioning =>true,:fallbacks_for_empty_translations => true
translates :desc, :versioning =>true,:fallbacks_for_empty_translations => true
end