Remote Ruby cover image

Remote Ruby

Ain't Your Callback Girl

Aug 25, 2023
In this episode, the hosts discuss generated columns and callbacks in Rails databases, including their benefits, limitations, and testing challenges. They also explore the HTML Pipeline library, GitHub markdown processing, and Rails rendering of rich text associations. Personal anecdotes and reminiscing about early GitHub days add humor to the conversation.
35:09

Podcast summary created with Snipd AI

Quick takeaways

  • Virtual generated columns in Rails provide a simplified way to automatically generate database columns based on the values of other columns, eliminating the need for complex callbacks.
  • Callbacks in Rails can be powerful but should be used with caution, as they can lead to potential issues and difficulties in testing, requiring a thorough understanding of their purpose and pitfalls.

Deep dives

Virtual Generated Columns in Databases

Virtual generated columns, also known as generated columns, are a feature in Rails that allow for the creation of columns in a database that are automatically generated based on the values of other columns. This feature was added to Rails 7, providing support for virtual columns in Postgres. The virtual column is calculated based on specified logic, such as concatenating two other columns with a space in between. Any changes to the original columns will automatically update the virtual column. This feature eliminates the need for complex callbacks and simplifies database operations.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode