You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's an edge case where a virtual column referencing a column with default value is created, the virtual column returns nil if the user doesn't force model reloading (#reload).
Test failing:
test_fills_auto_populated_columns_on_creation
Investation
As of now, I found out that the generated sql on insert doesn't include the virtual column, and it seems to be on purpose (See PostgreSQL::Column#has_default? or Column#auto_populated?). Hence the next step would be to verify the related behaviour with the postgresql adaptor directly to see when the value is added to the model.
The text was updated successfully, but these errors were encountered:
There's an edge case where a virtual column referencing a column with default value is created, the virtual column returns
nil
if the user doesn't force model reloading (#reload
).Test failing:
Investation
As of now, I found out that the generated sql on insert doesn't include the virtual column, and it seems to be on purpose (See
PostgreSQL::Column#has_default?
orColumn#auto_populated?
). Hence the next step would be to verify the related behaviour with the postgresql adaptor directly to see when the value is added to the model.The text was updated successfully, but these errors were encountered: