diff --git a/app/models/problem.rb b/app/models/problem.rb --- a/app/models/problem.rb +++ b/app/models/problem.rb @@ -3,8 +3,9 @@ belongs_to :description validates_presence_of :name + validates_format_of :name, :with => /^\w+$/ validates_presence_of :full_name - + def self.find_available_problems find(:all, :conditions => {:available => true}, :order => "date_added DESC") end