mirror of
https://github.com/redmine/redmine.git
synced 2026-03-04 03:21:24 +01:00
added some validations for lists and messages
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@272 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -22,7 +22,7 @@ class MailingList < ActiveRecord::Base
|
||||
belongs_to :admin, :class_name => 'User', :foreign_key => 'admin_id'
|
||||
has_many :messages, :class_name => 'MailingMessage', :dependent => :delete_all
|
||||
|
||||
validates_presence_of :name, :description, :password
|
||||
validates_presence_of :name, :description, :password, :admin_id
|
||||
validates_confirmation_of :password
|
||||
validates_format_of :name, :with => /^[a-z0-9\-]+$/i
|
||||
|
||||
|
||||
@@ -18,4 +18,6 @@
|
||||
class MailingMessage < ActiveRecord::Base
|
||||
belongs_to :mailing_list
|
||||
acts_as_tree :order => 'sent_on'
|
||||
|
||||
validates_uniqueness_of :messageid, :scope => :mailing_list_id
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user