From 688d3a89e55da486b9f09a916d7d04ca57e434ee Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Wed, 27 Nov 2013 11:11:57 +0100 Subject: [PATCH] fixed issue #81 --- app/models/studium.rb | 2 +- config/locales/de.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/studium.rb b/app/models/studium.rb index 4648baf..525bfeb 100755 --- a/app/models/studium.rb +++ b/app/models/studium.rb @@ -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 diff --git a/config/locales/de.yml b/config/locales/de.yml index 8b26a65..ac4713e 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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"