title: Facebook Authentication with MongoMapper
body: <p>I am trying to integrate Facebook authentication into a Rails application with mongomapper and I am getting an error on the following method.  I think the error is in the first_or_initialize section because it is ActiveRecord query instead of mongomapper.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>end</p>
  
  <p>EDIT:
  <img src="https://i.stack.imgur.com/Ymw72.png" alt="Here is the terminal output when the error is thrown">
  Any suggestions?</p>