diff options
author | Rhenium <rhenium@rhe.jp> | 2014-01-17 23:26:18 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-01-17 23:26:18 +0900 |
commit | 54c58ee2a0967177d8eff2c74b0f14d90d8a6cb4 (patch) | |
tree | 782779859851e967540dbc358f689bf5f84da3d5 /app/controllers/users_controller.rb | |
parent | f631ac6b963eee49d909449a582ac2e3683ca6bd (diff) | |
download | aclog-54c58ee2a0967177d8eff2c74b0f14d90d8a6cb4.tar.gz |
change Array#to_h to Hash.[]: Array#to_h is only in Ruby 2.1.0...
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 28bec9c..95b4626 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -21,7 +21,7 @@ class UsersController < ApplicationController respond_to do |format| format.html do - @cached_users = User.find(@result.map {|user_id, count| user_id }).map {|user| [user.id, user] }.to_h + @cached_users = Hash[User.find(@result.map {|user_id, count| user_id }).map {|user| [user.id, user] }] end format.json do @@ -40,7 +40,7 @@ class UsersController < ApplicationController respond_to do |format| format.html do - @cached_users = User.find(@result.map {|user_id, count| user_id }).map {|user| [user.id, user] }.to_h + @cached_users = Hash[User.find(@result.map {|user_id, count| user_id }).map {|user| [user.id, user] }] end format.json do |