Module: BookingSync::Engine::Model::ClassMethods
- Defined in:
- lib/bookingsync/engine/model.rb
Instance Method Summary collapse
Instance Method Details
#from_omniauth(auth) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bookingsync/engine/model.rb', line 5 def from_omniauth(auth) auth_params = auth.slice(:provider, :uid).permit(:provider, :uid) where(auth_params).first_or_initialize.tap do |account| account.provider = auth.provider account.uid = auth.uid account.name = auth.info.business_name account.update_token(auth.credentials) account.save! end end |