From: Toshi MARUYAMA Date: Thu, 26 Apr 2012 23:51:25 +0000 (+0000) Subject: replace Rails2 "named_scope" to Rails3 "scope" at lib/plugins/acts_as_watchable/lib... X-Git-Tag: 2.0.0~137 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bf4d779ea209084affcb1b800343051bd38422ad;p=redmine.git replace Rails2 "named_scope" to Rails3 "scope" at lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9538 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb index 5420da0fe..1f8877584 100644 --- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb +++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb @@ -13,7 +13,7 @@ module Redmine has_many :watchers, :as => :watchable, :dependent => :delete_all has_many :watcher_users, :through => :watchers, :source => :user, :validate => false - named_scope :watched_by, lambda { |user_id| + scope :watched_by, lambda { |user_id| { :include => :watchers, :conditions => ["#{Watcher.table_name}.user_id = ?", user_id] } }