mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-11 19:53:07 +00: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:
parent
7710e18c4a
commit
1a41d1aab4
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user