[FEATURE REQUEST] Implement returning for postgresql calculated columns

When you have a column calculated in Postgres, you need to call reload for the values to fetched from the DB.

I think it would be great if rails models could accept a list of parameters that shuold be returned after a DB operation using postgres RETURNING feature, just like it is happening with the record id.

I have opened a PR implementing this feature for create operation. The test suite is in red for now but the relevant test is passing locally.

Adding this feature has been discussed in this GH issue, but I’m posting it here per @matthewd 's suggestion. Please let me know if you guys think this feature will be accepted and I will continue working in the PR.

6 Likes

@matthewd what would be needed to get the feature request approved? I’d be happy to work with @00dav00 on implementing it as the core team sees fit.

1 Like