開発環境はRuby2.3.1p112、Rails5.0.1です。
Ruby on Railsでrails g devise:install
をしたところ、以下のような注意書きがでました。
W, [2017-02-04T02:04:56.376924 #841] WARN -- : You are setting a key that conflicts with a built-in method OmniAuth::AuthHash::InfoHash#name defined at /Users/T.Yoshinori/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/omniauth-1.3.2/lib/omniauth/auth_hash.rb:34. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method. Running via Spring preloader in process 868
事前にdevise
とomniauth-facebook
、omniauth-twitter
のgemをインストールしているので、omniauthについての注意書きであることは察しがつきました。
そして、auth_hash.rbの34行目以降を確認したところ
def name return self[:name] if self[:name] return "#{first_name} #{last_name}".strip if first_name? || last_name? return nickname if nickname? return email if email? nil end
と書かれており何が問題なのかさっぱりわかりませんでした。
これはどういった問題であり、かつ、どのように対処したら良いのでしょうか。
もし、差し支えなければ、このような状況を作ってしまった原因として考えられる理由も知りたいです。
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/11/30 05:09