I'm working with Twitter and Facebook omni auth
I've this method that creates a user
def self.find_or_create_from_auth_hash(auth_hash)
user = where(provider: auth_hash[:provider], uid: auth_hash[:uid]).first_or_create
user.update(
name: auth_hash.info.name,
profile_image: auth_hash.info.image,
token: auth_hash.credentials.token,
secret: auth_hash.credentials.secret,
url: auth_hash.info.urls.Twitter,
nickname: auth_hash.info.nickname
)
user
end
How do I make it so that if provider is Twitter do
url: auth_hash.info.urls.Twitter,
But if provider is Facebook, do this instead
url: auth_hash.info.urls.Facebook,