title: How to encrypt password with has_secure_password in Rails 4.2
body: <p>I've an API and I installed the next gem</p>
  
  <pre><code> gem 'bcrypt' 
  </code></pre>
  
  <p>And into my user model I specific that:</p>
  
  <pre><code>has_secure_password
  </code></pre>
  
  <p>My DataBase Have a field with name</p>
  
  <pre><code>password_digest
  </code></pre>
  
  <p>And when run the seeders Yea the password is encrypted, But when try to create a new user from my method the password is normal, This my method for create new user</p>
  
  <pre><code>def self.from_auth(data)
      User.where(email: data[:email]).first_or_create do |user|
          user.email = data[:info][:email]
          user.name = data[:info][:name]
          user.provider = data[:info][:provider]
          user.uid = data[:info][:uid]
          user.password_digest = data[:info][:password]
      end
  end
  </code></pre>
  
  <p>Thanks :)</p>