Why joins queries make result readonly?

This might be a hangover from the past - I think active record didn’t use to default to orders.* - the default select clause was select *.

The danger is only if you do select columns from the other tables. This can either prevent saves (because your object has an attribute that doesn’t exist for the model) or mask existing data, eg if both of the joined tables have a client_id column and you do select * then the activerecord object will have a single client_id attribute that has only one of those values.

Fred

Should the OP be using includes rather than joins?

Colin

Hard to tell.

Fred