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
This commit is contained in:
parent
d0d01d4e70
commit
bf4d779ea2
|
@ -13,7 +13,7 @@ module Redmine
|
||||||
has_many :watchers, :as => :watchable, :dependent => :delete_all
|
has_many :watchers, :as => :watchable, :dependent => :delete_all
|
||||||
has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
|
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,
|
{ :include => :watchers,
|
||||||
:conditions => ["#{Watcher.table_name}.user_id = ?", user_id] }
|
:conditions => ["#{Watcher.table_name}.user_id = ?", user_id] }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue