【发布时间】:2014-11-22 09:19:01
【问题描述】:
我正在使用来自
的代码组合http://railscasts.com/episodes/360-facebook-authentication?view=asciicast
oauth 部分并尝试将其与 neo4J 集成
https://github.com/neo4jrb/neo4j
据我所知,这个 gem 替换了许多活动记录片段,包括数据类型。
我正在尝试替换此代码块。他们将oauth_expires_at 设置为我不相信neo4j gem 具有的日期时间数据类型(我假设我不能使用日期类型,因为在这种情况下活动记录被neo4j 替换)。有什么办法可以解决这个问题?
def self.from_omniauth(auth)
where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user|
user.provider = auth.provider
user.uid = auth.uid
user.name = auth.info.name
user.oauth_token = auth.credentials.token
user.oauth_expires_at = Time.at(auth.credentials.expires_at)
user.save!
end
end
【问题讨论】:
标签: ruby-on-rails ruby neo4j facebook-oauth neo4j.rb