|
|
@ -230,7 +230,7 @@ module Carto
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def build_client_application_from_hash(client_app_hash)
|
|
|
|
def build_client_application_from_hash(client_app_hash)
|
|
|
|
return nil unless client_app_hash
|
|
|
|
return unless client_app_hash
|
|
|
|
|
|
|
|
|
|
|
|
client_application = Carto::ClientApplication.create(
|
|
|
|
client_application = Carto::ClientApplication.create(
|
|
|
|
name: client_app_hash[:name],
|
|
|
|
name: client_app_hash[:name],
|
|
|
@ -239,11 +239,11 @@ module Carto
|
|
|
|
callback_url: client_app_hash[:callback_url],
|
|
|
|
callback_url: client_app_hash[:callback_url],
|
|
|
|
oauth_tokens: client_app_hash[:oauth_tokens].map { |t| build_oauth_token_fom_hash(t) },
|
|
|
|
oauth_tokens: client_app_hash[:oauth_tokens].map { |t| build_oauth_token_fom_hash(t) },
|
|
|
|
access_tokens: client_app_hash[:access_tokens].map { |t| build_oauth_token_fom_hash(t) },
|
|
|
|
access_tokens: client_app_hash[:access_tokens].map { |t| build_oauth_token_fom_hash(t) },
|
|
|
|
user_id: client_app_hash[:user_id]
|
|
|
|
user_id: client_app_hash[:user_id],
|
|
|
|
|
|
|
|
key: client_app_hash[:key],
|
|
|
|
|
|
|
|
secret: client_app_hash[:secret]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
# Overwrite fields that were created with ORM lifecycle callbacks
|
|
|
|
# Overwrite fields that were created with ORM lifecycle callbacks
|
|
|
|
client_application.key = client_app_hash[:key]
|
|
|
|
|
|
|
|
client_application.secret = client_app_hash[:secret]
|
|
|
|
|
|
|
|
client_application.created_at = client_app_hash[:created_at]
|
|
|
|
client_application.created_at = client_app_hash[:created_at]
|
|
|
|
client_application.updated_at = client_app_hash[:updated_at]
|
|
|
|
client_application.updated_at = client_app_hash[:updated_at]
|
|
|
|
client_application
|
|
|
|
client_application
|
|
|
|