afair / postgresql_cursor

ActiveRecord PostgreSQL Adapter extension for using a cursor to return a large result set
MIT License
599 stars 48 forks source link

Avoid referencing the AR connection adapter in the toplevel #42

Closed amatsuda closed 4 years ago

amatsuda commented 5 years ago

This PR fixes #41 not by documenting but by fixing the code.

This implementation expects AR postgresql connection adapter to be already loaded while loading this gem, but this assumption is not always true because AR usually loads the adapters after loading config/database.yml and datermining the database adapter to load.

Also, defining a global constant like this OID thing inside a gem is pretty rude. It may conflict with the users' application code or other gems.

This new constant has been introduced via #35 just for resolving an ambiguous OID constant refernce, but that ambiguity here could be more simply and naturally solved just by referencing the constant with the absolute path per each AR version.

IlyaKamenkoTrycarriage commented 5 years ago

👍

johvet commented 5 years ago

👍