rom-sql icon indicating copy to clipboard operation
rom-sql copied to clipboard

Translate symbols in a hash applied to `Relation#where` to attributes

Open flash-gordon opened this issue 3 years ago • 1 comments

We store qualified attributes in schemas, that's good. But when you call .where(name: 'abc') then symbols from the hash don't get converted to attributes from the schema and thus get translated to unqualified SQL identifiers. At the same time, using the block syntax will produce qualified attributes: where { name.is('abc') }. This discrepancy confuses people, we should transform symbol keys into qualified attributes. This will be a breaking change.

flash-gordon avatar Feb 22 '21 12:02 flash-gordon

Ah yes, we wanted to do it long time ago :) I'm glad you reported an issue about it <3

solnic avatar Feb 23 '21 05:02 solnic