diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-22 17:37:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-22 17:37:16 +0000 |
commit | 2d1866d966d94c688f9cb87c5bf3f096dffac844 (patch) | |
tree | 7a733c1cc51448ab69b3f892285305dbfb0ae15e /app/controllers/users_controller.rb | |
parent | a6ec78a4dc658e3517ed682792016b6530458696 (diff) | |
download | redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.tar.gz redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.zip |
Merged rails-4.1 branch (#14534).
git-svn-id: http://svn.redmine.org/redmine/trunk@13482 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c5db58988..bb56fb285 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -47,7 +47,7 @@ class UsersController < ApplicationController @user_count = scope.count @user_pages = Paginator.new @user_count, @limit, params['page'] @offset ||= @user_pages.offset - @users = scope.order(sort_clause).limit(@limit).offset(@offset).all + @users = scope.order(sort_clause).limit(@limit).offset(@offset).to_a respond_to do |format| format.html { @@ -60,7 +60,7 @@ class UsersController < ApplicationController def show # show projects based on current user visibility - @memberships = @user.memberships.where(Project.visible_condition(User.current)).all + @memberships = @user.memberships.where(Project.visible_condition(User.current)).to_a events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 10) @events_by_day = events.group_by(&:event_date) @@ -90,7 +90,7 @@ class UsersController < ApplicationController @user.admin = params[:user][:admin] || false @user.login = params[:user][:login] @user.password, @user.password_confirmation = params[:user][:password], params[:user][:password_confirmation] unless @user.auth_source_id - @user.pref.attributes = params[:pref] + @user.pref.attributes = params[:pref] if params[:pref] if @user.save Mailer.account_information(@user, @user.password).deliver if params[:send_information] @@ -134,7 +134,7 @@ class UsersController < ApplicationController # Was the account actived ? (do it before User#save clears the change) was_activated = (@user.status_change == [User::STATUS_REGISTERED, User::STATUS_ACTIVE]) # TODO: Similar to My#account - @user.pref.attributes = params[:pref] + @user.pref.attributes = params[:pref] if params[:pref] if @user.save @user.pref.save |