Rails 7 adds setting for enumerating columns in select statements | BigBinary Blog

02-Nov-2021 2590
Rails 7 has introduced a new setting called enumerate_columns_in_select_statements for enumerating columns in activerecord select query statements by which we can avoid common ActiveRecord::PreparedStatementCacheExpired errors.Rails uses prepared statements for database query efficiency. When prepared statements are being used, the repeated queries will be cached based on the prepared statement query plan at Postgres database level. This cached value will become invalid when the returned results are changed.

Free eBook download

Download all our eBooks for free from Gumroad!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these books offer thousands of essential questions and answers across multiple languages. Download the complete collection for free from our Gumroad page. Free Ultimate Job Interview Preparation eBook collection