2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails5.0.xでeach_valueがwarningになる

Last updated at Posted at 2017-04-17

ActionController Parametersでeachしてvalueを取ろうとするときにwarningになった

環境

Ruby 2.3.0
Rails 5.0.0.1

問題

object.each_value do |value|
     # 処理
end

を5.0.0.1でやるとwarningが出る

解決

object.transform_values do |value|
     # 処理
end

transform_valuesを使おう!

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?