3

我正在嘗試將Koala整合到一個設計omniauth-facebook應用程序中。出於某種原因,我無法發佈到用戶的牆上。我創建了第二個不使用設計和所有作品的應用程序,我意識到唯一的區別是oauth_expires_at我在保存facebook返回的oauth_expires_at時遇到問題。Rails 3.2 Devise Omniauth-Facebook和考拉

# Facebook 
    def self.find_for_facebook_oauth(auth, signed_in_resource=nil) 
    user = User.where(:provider => auth.provider, :uid => auth.uid).first 
      unless user 
      user = User.create( name:auth.extra.raw_info.name, 
           provider:auth.provider, 
           uid:auth.uid, 
           email:auth.info.email, 
           image:auth.info.image, 
           oauth_token:auth.credentials.token, 
           password:Devise.friendly_token[0,20] 
           ) 
      end 
     user 
    end 

我已經試過

#oauth_expires_at:auth.credentials.expires_at.to_datetime, 
#oauth_expires_at:auth.Time.at(auth['credentials'].expires_at), 
#oauth_expires_at:Time.at(@auth[:credentials][:expires_at]).to_datetime, 

如何轉換Facebook的時間響應PostgreSQL的日期時間格式。請幫忙。或者它有什麼關係?

回答

2

看起來像oauth_expires_at畢竟沒有引起問題。我立場糾正。