summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/watcher.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/watcher.rb b/app/models/watcher.rb
index de111185a..c42b55f5f 100644
--- a/app/models/watcher.rb
+++ b/app/models/watcher.rb
@@ -21,6 +21,7 @@ class Watcher < ActiveRecord::Base
validates_presence_of :user
validates_uniqueness_of :user_id, :scope => [:watchable_type, :watchable_id]
+ validate :validate_user
# Unwatch things that users are no longer allowed to view
def self.prune(options={})
@@ -37,7 +38,7 @@ class Watcher < ActiveRecord::Base
protected
- def validate
+ def validate_user
errors.add :user_id, :invalid unless user.nil? || user.active?
end