ian bradbury

August 19, 2021

How to configure Rails Active Storage to use UUIDs for database primary keys

Scenario = you'd love to use Active Storage but you need storage blob uri's to be non-guessable. Or, maybe you already have an app that uses UUIDs and you're looking to add ActiveStorage to the application. Read on.... I will assume that you're running Rails v6+ and Postgres v9.1+ that has already been configured to use UUIDs. (You can...
Read more

August 19, 2021

How to configure Ruby on Rails and Postgres to use UUIDs for primary keys

Scenario = you want or need to increase your application security by switching from simple integer based database primary keys to much more secure UUID's. Example UUID uri: https://www.my-app.com/invoices/5e2e0f3e-71d9-4a0a-a0f1-1f67cd6a418e How do you configure Rails to use UUIDs for your database IDs? I will assume that you're runnin...
Read more

August 19, 2021

How to display HTML client rendered localised date/time values

How to display date/time, localised with only a small - manageable - amount of JavaScript? Scenario = you need to display some date/time data from your server that gets localised as the browser page is rendered. All without having to stress about user timezones or any daylight saving that might be in effect. CHECK : All our servers run...
Read more