Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Yuanyi authored and Zhang Yuanyi committed Sep 5, 2010
1 parent cee0529 commit 343275f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def name
self.fields.each do |field|
klass.key "f#{field.id}", String
klass.validates_presence_of "f#{field.id}".to_sym, :message => I18n.t('activemodel.errors.messages.blank') if field.required
klass.validates_format_of "f#{field.id}".to_sym, :with => Authentication.email_regex if field.intern == 'email'
klass.validates_uniqueness_of "f#{field.id}", :message => I18n.t('activemodel.errors.messages.taken') if field.unique

if field.input == 'check' || field.input == 'radio'
klass.class_eval <<-METHOD
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ en:
errors:
messages:
blank: "can't be blank"
taken: "already been taken"

logo: 'en-logo.png'
create_survey: "Create Survey"
Expand Down

0 comments on commit 343275f

Please sign in to comment.