Code cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11960 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-06-11 18:29:29 +00:00
parent e0c7eb25a4
commit 7371077fa2
1 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,8 @@ module Redmine
has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
scope :watched_by, lambda { |user_id|
{ :include => :watchers,
:conditions => ["#{Watcher.table_name}.user_id = ?", user_id] }
joins(:watchers).
where("#{Watcher.table_name}.user_id = ?", user_id)
}
attr_protected :watcher_ids, :watcher_user_ids
end