Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sc 177364/feature request add cloud information to #16349

Merged

Conversation

moicalcob
Copy link
Collaborator

Resources

Shortcut story

Context

The user's database location is needed to perform operations, such as using the SE for BQ. The users can't find this information easily in CARTO.

Changes

The database's location is shown in the user's profile page now.

@moicalcob moicalcob self-assigned this Sep 29, 2021
@shortcut-integration
Copy link

Copy link
Collaborator

@Shylpx Shylpx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Good job! I just added a comment to improve code readability.

@@ -6,7 +6,7 @@ module FrontendConfigHelper

def frontend_config_hash(user = current_user)
config = {
region: Cartodb.get_config(:bigquery_region),
region: Cartodb.get_config(:bigquery_region) ? Cartodb.get_config(:bigquery_region).upcase : nil,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to call a method only if it is defined, you can also use try: https://apidock.com/rails/v4.2.1/Object/try, instead of a conditional ternary operator. That way, Cartodb.get_config(:bigquery_region) will call upcase only if it is defined, and it'll return nil otherwise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen the try option, going to change it! Thanks so much!! 🙇🏼

@moicalcob moicalcob merged commit 26896f0 into master Sep 29, 2021
@moicalcob moicalcob deleted the feature/sc-177364/feature-request-add-cloud-information-to branch September 29, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants