From e7b6a56a972eaed14386d737929f84a7ef59e9a5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 30 Nov 2008 16:57:56 +0000 Subject: Replaces User.find_active with a named scope. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2079 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/account_controller.rb | 2 +- app/controllers/application.rb | 2 +- app/controllers/projects_controller.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index f327dd5b6..fe44740a4 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -24,7 +24,7 @@ class AccountController < ApplicationController # Show user's account def show - @user = User.find_active(params[:id]) + @user = User.active.find(params[:id]) @custom_values = @user.custom_values # show only public projects and private projects that the logged in user is also a member of diff --git a/app/controllers/application.rb b/app/controllers/application.rb index e5719a059..36123ba47 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -46,7 +46,7 @@ class ApplicationController < ActionController::Base def find_current_user if session[:user_id] # existing session - (User.find_active(session[:user_id]) rescue nil) + (User.active.find(session[:user_id]) rescue nil) elsif cookies[:autologin] && Setting.autologin? # auto-login feature User.find_by_autologin_key(cookies[:autologin]) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 43e1ae035..9b3316682 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -227,7 +227,7 @@ class ProjectsController < ApplicationController @date_to ||= Date.today + 1 @date_from = @date_to - @days @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') - @author = (params[:user_id] ? User.find_active(params[:user_id]) : nil) + @author = (params[:user_id] ? User.active.find(params[:user_id]) : nil) @activity = Redmine::Activity::Fetcher.new(User.current, :project => @project, :with_subprojects => @with_subprojects, -- cgit v1.2.3