diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-09-17 17:22:03 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-17 17:22:03 +0100 |
commit | abde5e4a1139c41c6db23ce041fba090674f65ac (patch) | |
tree | 19c6f35930d23725bb0b67416436d6a0c179a09b /app/models/info_request.rb | |
parent | 1accd9f2f86022f90f848b39182570d1613eb6be (diff) | |
parent | 777ed1016b23d577f4cee62f49961e1d44bc346d (diff) |
Merge branch 'feature/issue-902-fix' into rails-3-develop
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index c0b8e2fca..d9a1a65fe 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 # == Schema Information # Schema version: 20120919140404 # @@ -31,7 +32,10 @@ class InfoRequest < ActiveRecord::Base strip_attributes! validates_presence_of :title, :message => N_("Please enter a summary of your request") - validates_format_of :title, :with => /[a-zA-Z]/, :message => N_("Please write a summary with some text in it"), :if => Proc.new { |info_request| !info_request.title.nil? && !info_request.title.empty? } + # TODO: When we no longer support Ruby 1.8, this can be done with /[[:alpha:]]/ + validates_format_of :title, :with => /[ёЁа-яА-Яa-zA-Zà-üÀ-Ü]/iu, + :message => N_("Please write a summary with some text in it"), + :if => Proc.new { |info_request| !info_request.title.nil? && !info_request.title.empty? } belongs_to :user validate :must_be_internal_or_external |