##// END OF EJS Templates
replace Rails2 "named_scope" to Rails3 "scope" at lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb...
Toshi MARUYAMA -
r9356:bf4d779ea209
parent child
Show More
@@ -13,7 +13,7 module Redmine
13 has_many :watchers, :as => :watchable, :dependent => :delete_all
13 has_many :watchers, :as => :watchable, :dependent => :delete_all
14 has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
14 has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
15
15
16 named_scope :watched_by, lambda { |user_id|
16 scope :watched_by, lambda { |user_id|
17 { :include => :watchers,
17 { :include => :watchers,
18 :conditions => ["#{Watcher.table_name}.user_id = ?", user_id] }
18 :conditions => ["#{Watcher.table_name}.user_id = ?", user_id] }
19 }
19 }
General Comments 0
You need to be logged in to leave comments. Login now