instacart / makara

A Read-Write Proxy for Connections; Also provides an ActiveRecord adapter.
http://tech.taskrabbit.com/
MIT License
923 stars 170 forks source link

ActiveRecord::Base.connection.select raises TypeError with makara-0.5.1 #326

Open j-miyake opened 3 years ago

j-miyake commented 3 years ago

With makara-0.5.1, ActiveRecord::Base.connection.select raises TypeError, while it returns ActiveRecord::Result with makara-0.5.0.

with makara-0.5.1

pry(main)> ActiveRecord::Base.connection.select("select * from users limit 1")
TypeError: wrong argument type String (expected Array)

with makara-0.5.0

pry(main)> ActiveRecord::Base.connection.select("select * from users limit 1")
=> #<ActiveRecord::Result:0x000000000c2350d0
jeremy commented 3 years ago

Confirmed. There's a regression here: https://github.com/instacart/makara/pull/283/files#r695483360

In Makara 0.5.1, #select is now calling the private Kernel#select on the ConnectionWrapper instead of hitting method_missing to talk to the connection adapter itself.