Sunday 15 February 2015

ruby on rails - Neo4J gem datetime datatype -



ruby on rails - Neo4J gem datetime datatype -

i'm using combination of code from

http://railscasts.com/episodes/360-facebook-authentication?view=asciicast

oauth portion , trying integrate neo4j

https://github.com/neo4jrb/neo4j

as far know gem replaces many active record pieces, including datatypes.

i trying replace block of code. have oauth_expires_at set datetime info type don't believe neo4j gem has (i assuming can't utilize datetype because active record replaced neo4j in case). might options deal this?

def self.from_omniauth(auth) where(auth.slice(:provider, :uid)).first_or_initialize.tap |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

the gem back upwards datetime! add together appropriate properties model.

class user include neo4j::activenode property :provider property :uid property :name property :oauth_token property :auth_expries_at, type: datetime end

ruby-on-rails ruby neo4j facebook-oauth neo4j.rb

No comments:

Post a Comment