As of Rails 7, ActiveRecord supports generated columns for app's backed by a PostgreSQL database. This is achieved with a virtual column.
Maybe #quoted_column_names in schema_statements.rb could check if a column-name is a string and if it's wrapped with parenthesis (so it looks like an expression) it could pass it through.