Describe the bug
When using by_pk with one value while the table has composite primary key, ROM can raise stack overflow error.
To Reproduce
create table users (
id VARCHAR(50),
tenant_id VARCHAR(50),
primary key (id, tenant_id)
)
require "rom"
rom = ROM.container(:sql, 'postgres://localhost/test') do |config|
config.relation(:users) do
schema(infer: true)
auto_struct true
end
end
users = rom.relations[:users]
users.by_pk('0049d2d1-b433-48d7-818a-a2672ae05fa').one
Expected behavior
The error should be raised with incorrect number of argument message.
My environment
- Affects my production application: NO
- Ruby version: 3.3.0
- OS: MacOS 14.4.1
Describe the bug
When using
by_pkwith one value while the table has composite primary key, ROM can raise stack overflow error.To Reproduce
Expected behavior
The error should be raised with incorrect number of argument message.
My environment