fixed issue #81

This commit is contained in:
Thomas Blazek
2013-11-27 11:11:57 +01:00
parent e5c1f23131
commit 688d3a89e5
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ class Studium < ActiveRecord::Base
validates :abkuerzung, :length=>{:maximum=>5}, :format=>{:with=>/^[a-zA-z]{0,5}$/}
validates :typ, :inclusion => {:in => ["Bachelor","Master"] }
validates :name, :uniqueness => true, :presence=>true
validates :zahl, :presence=>true, :format=>{:with=>/^0(33|66)[0-9]{3}$/}, :uniqueness => true
validates :zahl, :presence=>true, :format=>{:with=>/^[0-9A-Z]{4,10}$/}, :uniqueness => true
mount_uploader :picture, PictureUploader
translates :desc,:shortdesc, :versioning =>true,:fallbacks_for_empty_translations => true
def title_context

View File

@@ -71,7 +71,7 @@ de:
attributes:
zahl:
blank: "Geben Sie die Studienkennzahl an"
invalid: "Die eingegebene Form stimmt nicht (beginnend mit 033 oder 066, dann 3 Stellen)"
invalid: "Die eingegebene Form stimmt nicht. (4-10 Zeichen, Ziffern und Großbuchstaben"
taken: "Die Kennzahl wird bereits verwendet"
name:
blank: "Geben Sie den Namen des Studiums ein"