The Bike Shed cover image

The Bike Shed

410: All About Documentation

Dec 12, 2023
The podcast discusses challenges with handling JSON in a Postgres database using ActiveRecord, bookmarklets like 'Check This Out' for Libby, and the importance of accurate documentation, highlighting the pitfalls of using constants in code for system behavior.
32:02

Podcast summary created with Snipd AI

Quick takeaways

  • Dealing with JSON in a Postgres database requires careful handling to ensure proper storage and retrieval.
  • Using constants in code for documentation can lead to misunderstandings and hinder flexibility when values change frequently.

Deep dives

Challenges with JSONB Column in Postgres Database

Dealing with a situation involving an active record model with a JSONB column presented unexpected challenges. While active record typically handles data conversions seamlessly, attempting to save a JSON string into a JSONB column led to storing it as a raw string rather than a hash. The lack of automatic deserialization due to the varied nature of JSON values required manual intervention to parse the string into a hash before setting the attribute on the model. This experience highlighted the need for careful handling of JSON data in such scenarios to ensure proper storage and retrieval.

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner
Get the app