cartodb-4.42/app/models/carto/synchronization_oauth.rb

19 lines
543 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
require 'active_record'
module Carto
class SynchronizationOauth < ActiveRecord::Base
belongs_to :user, class_name: 'Carto::User', inverse_of: :synchronization_oauths
# TODO: partial duplication with DataImportsService (this one hasn't redis_storage)
def get_service_datasource
datasource = CartoDB::Datasources::DatasourcesFactory.get_datasource(service, user, {
http_timeout: ::DataImport.http_timeout_for(user)
})
datasource.token = token unless datasource.nil?
datasource
end
end
end