summaryrefslogtreecommitdiffstats
path: root/app/controllers/watchers_controller.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-10 12:49:52 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-10 12:49:52 +0000
commita7b8e6c02a473134e3ba8097133d3f05aa76decb (patch)
tree1719ddc1bcd0c227cc58f09fee64755a1fa24575 /app/controllers/watchers_controller.rb
parenta3f0dae9c4cd3aeeba109b18c26285cfd4264746 (diff)
downloadredmine-a7b8e6c02a473134e3ba8097133d3f05aa76decb.tar.gz
redmine-a7b8e6c02a473134e3ba8097133d3f05aa76decb.zip
Rails4: replace deprecated find_all_by_* at WatchersController
git-svn-id: http://svn.redmine.org/redmine/trunk@12616 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/watchers_controller.rb')
-rw-r--r--app/controllers/watchers_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index 2f55de2f0..325e9e9f2 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -52,7 +52,7 @@ class WatchersController < ApplicationController
def append
if params[:watcher].is_a?(Hash)
user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]]
- @users = User.active.find_all_by_id(user_ids)
+ @users = User.active.where(:id => user_ids).all
end
end
@@ -91,7 +91,7 @@ class WatchersController < ApplicationController
def find_watchables
klass = Object.const_get(params[:object_type].camelcase) rescue nil
if klass && klass.respond_to?('watched_by')
- @watchables = klass.find_all_by_id(Array.wrap(params[:object_id]))
+ @watchables = klass.where(:id => Array.wrap(params[:object_id])).all
raise Unauthorized if @watchables.any? {|w| w.respond_to?(:visible?) && !w.visible?}
end
render_404 unless @watchables.present?