-
Notifications
You must be signed in to change notification settings - Fork 650
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
Feature/sc 177364/feature request add cloud information to #16349
Conversation
This reverts commit b6130ae.
This pull request has been linked to Shortcut Story #177364: Feature request: Add cloud information to Builder Dashboard. |
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!! 🙇🏼
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.