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
I have a relationship that includes selected columns (I'm honestly doubting whether this is a good idea at all now that I've ran into this), and it worked through 4.0.x. Updating the app to 4.1.0rc1 showed this behavior no longer works and results in an SQL error, as the select is not dropped from the query constructed.
Essentially, creating a relationship in this fashion (my actual use case is more sane, at least in theory, separating two very distinct classifications of relationships but also wanting to get the join table properties as well):
Yes, This behavior changed and it is documented in the CHANGELOG. The reason is sometime someone want to select being applied (and it make sense) and how it worked before doesn't allow this. Now select are applied unless you choose to not.
Can you confirm that the correct fix in the app to include .count(:all)?
This wasn't adequately explained in the CHANGELOG (in fact, searching for select in the 4.1 CHANGELOG doesn't yield any results at all). (Though it seems this is the right PR: #10710)
I have a relationship that includes selected columns (I'm honestly doubting whether this is a good idea at all now that I've ran into this), and it worked through 4.0.x. Updating the app to 4.1.0rc1 showed this behavior no longer works and results in an SQL error, as the
select
is not dropped from the query constructed.Essentially, creating a relationship in this fashion (my actual use case is more sane, at least in theory, separating two very distinct classifications of relationships but also wanting to get the join table properties as well):
In the gist I also have commented out the explicit
includes
andreferences
, as they don't make a difference in 4.1.Failing executable gist:
https://gist.github.com/jshirley/9744173
Note: This example does pass with activerecord 4.0.0 activated (the
select
is not included in the query).The text was updated successfully, but these errors were encountered: