mirror of
https://github.com/redmine/redmine.git
synced 2025-11-17 10:40:52 +01:00
Adds permissions for viewing the watcher list and adding new watchers on the issue detail view (#398).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1712 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -19,5 +19,12 @@ class Watcher < ActiveRecord::Base
|
||||
belongs_to :watchable, :polymorphic => true
|
||||
belongs_to :user
|
||||
|
||||
validates_presence_of :user
|
||||
validates_uniqueness_of :user_id, :scope => [:watchable_type, :watchable_id]
|
||||
|
||||
protected
|
||||
|
||||
def validate
|
||||
errors.add :user_id, :activerecord_error_invalid unless user.nil? || user.active?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user