Module: BookingSync::Engine::Model::ClassMethods

Defined in:
lib/bookingsync/engine/model.rb

Instance Method Summary collapse

Instance Method Details

#from_omniauth(auth) ⇒ Object


10
11
12
13
14
15
16
# File 'lib/bookingsync/engine/model.rb', line 10

def from_omniauth(auth)
  find_or_initialize_by(synced_id: auth.uid, provider: auth.provider).tap do ||
    .name = auth.info.business_name
    .update_token(auth.credentials)
    .save!
  end
end